diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 087d6e63..b3405a97 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -167,26 +167,6 @@ jobs: deb-s3 upload -l --bucket=apt.defguard.net --access-key-id=${{ secrets.AWS_ACCESS_KEY_APT }} --secret-access-key=${{ secrets.AWS_SECRET_KEY_APT }} --s3-region=eu-north-1 --no-fail-if-exists --codename=trixie --component="$COMPONENT" defguard-gateway_${{ env.VERSION }}_${{ matrix.target }}.deb - - name: Run `packer init` - if: matrix.build == 'linux' && matrix.arch == 'amd64' - id: init - run: "packer init ./images/ami/gateway.pkr.hcl" - - - name: Build AMI images for multiple regions - if: matrix.build == 'linux' && matrix.arch == 'amd64' - run: | - regions=(us-east-1 eu-west-1 ap-northeast-1 eu-central-1) - for region in "${regions[@]}"; do - echo "Building AMI for region: $region" - echo "Running packer validate for $region..." - packer validate --var "package_version=${{ env.VERSION }}" --var "region=$region" ./images/ami/gateway.pkr.hcl - echo "Building AMI image for $region..." - packer build -color=false -on-error=abort --var "package_version=${{ env.VERSION }}" --var "region=$region" ./images/ami/gateway.pkr.hcl - done - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - name: Build RPM package if: matrix.build == 'linux' uses: defGuard/fpm-action@main @@ -251,9 +231,8 @@ jobs: asset_name: defguard-gateway_${{ env.VERSION }}_x86_64-unknown-opnsense.pkg asset_content_type: application/octet-stream - apt-sign: - needs: + needs: - build-release runs-on: - self-hosted diff --git a/images/ami/gateway.pkr.hcl b/images/ami/gateway.pkr.hcl deleted file mode 100644 index 3b3bd353..00000000 --- a/images/ami/gateway.pkr.hcl +++ /dev/null @@ -1,62 +0,0 @@ -packer { - required_plugins { - amazon = { - version = ">= 1.2.8" - source = "github.com/hashicorp/amazon" - } - } -} - -variable "package_version" { - type = string -} - -variable "region" { - type = string - default = "eu-north-1" -} - -variable "instance_type" { - type = string - default = "t3.micro" -} - -source "amazon-ebs" "defguard-gateway" { - ami_name = "defguard-gateway-${var.package_version}-amd64" - instance_type = var.instance_type - region = var.region - source_ami_filter { - filters = { - name = "debian-13-amd64-*" - root-device-type = "ebs" - virtualization-type = "hvm" - } - most_recent = true - owners = ["136693071363"] - } - ssh_username = "admin" -} - -build { - name = "defguard-gateway" - sources = [ - "source.amazon-ebs.defguard-gateway" - ] - - provisioner "file" { - source = "defguard-gateway_${var.package_version}_x86_64-unknown-linux-gnu.deb" - destination = "/tmp/defguard-gateway.deb" - } - - provisioner "shell" { - script = "./images/ami/gateway.sh" - } - - provisioner "shell" { - inline = ["rm /home/admin/.ssh/authorized_keys"] - } - - provisioner "shell" { - inline = ["sudo rm /root/.ssh/authorized_keys"] - } -} diff --git a/images/ami/gateway.sh b/images/ami/gateway.sh deleted file mode 100644 index c0b769c9..00000000 --- a/images/ami/gateway.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -set -e - -echo "Updating apt repositories..." -sudo apt update - -echo "Installing Defguard Gateway package..." -sudo dpkg -i /tmp/defguard-gateway.deb - -echo "Cleaning up..." -sudo rm -f /tmp/defguard-gateway.deb - -echo "Defguard Gateway installation completed successfully."