From 607bcce445cde51de3165a37c9b20221b42b02fc Mon Sep 17 00:00:00 2001 From: Aleksander <170264518+t-aleksander@users.noreply.github.com> Date: Tue, 18 Nov 2025 13:34:12 +0100 Subject: [PATCH] remove ami --- .github/workflows/release.yml | 24 ++------------ images/ami/proxy.pkr.hcl | 62 ----------------------------------- images/ami/proxy.sh | 13 -------- 3 files changed, 2 insertions(+), 97 deletions(-) delete mode 100644 images/ami/proxy.pkr.hcl delete mode 100644 images/ami/proxy.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e68da3c..dd0a1d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -192,26 +192,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-proxy-${{ env.VERSION }}-${{ matrix.target }}.deb - - name: Run `packer init` - if: matrix.build == 'linux' && matrix.arch == 'amd64' - id: init - run: "packer init ./images/ami/proxy.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/proxy.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/proxy.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: bpicode/github-action-fpm@master @@ -231,7 +211,7 @@ jobs: asset_content_type: application/octet-stream apt-sign: - needs: + needs: - build-binaries runs-on: - self-hosted @@ -240,7 +220,7 @@ jobs: strategy: fail-fast: false steps: - - name: Sign APT repository on trixie + - name: Sign APT repository on trixie run: | export AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_APT }} export AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_KEY_APT }} diff --git a/images/ami/proxy.pkr.hcl b/images/ami/proxy.pkr.hcl deleted file mode 100644 index 3d3f5d6..0000000 --- a/images/ami/proxy.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-proxy" { - ami_name = "defguard-proxy-${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-proxy" - sources = [ - "source.amazon-ebs.defguard-proxy" - ] - - provisioner "file" { - source = "defguard-proxy-${var.package_version}-x86_64-unknown-linux-gnu.deb" - destination = "/tmp/defguard-proxy.deb" - } - - provisioner "shell" { - script = "./images/ami/proxy.sh" - } - - provisioner "shell" { - inline = ["rm /home/admin/.ssh/authorized_keys"] - } - - provisioner "shell" { - inline = ["sudo rm /root/.ssh/authorized_keys"] - } -} diff --git a/images/ami/proxy.sh b/images/ami/proxy.sh deleted file mode 100644 index 755458b..0000000 --- a/images/ami/proxy.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -set -e - -echo "Updating apt repositories..." -sudo apt update - -echo "Installing Defguard Proxy package..." -sudo dpkg -i /tmp/defguard-proxy.deb - -echo "Cleaning up..." -sudo rm -f /tmp/defguard-proxy.deb - -echo "Defguard Proxy installation completed successfully."