From 0e1f4b5cc828ca0c19e8994da9d0bacc84cf2a76 Mon Sep 17 00:00:00 2001 From: jayfranco999 Date: Fri, 25 Oct 2024 12:21:47 +0530 Subject: [PATCH 1/2] chore(updatecli):Track AMI ID Signed-off-by: jayfranco999 --- .../updatecli.d/ubuntu-22-04-images.yaml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 updatecli/updatecli.d/ubuntu-22-04-images.yaml diff --git a/updatecli/updatecli.d/ubuntu-22-04-images.yaml b/updatecli/updatecli.d/ubuntu-22-04-images.yaml new file mode 100644 index 000000000..d9020ac4d --- /dev/null +++ b/updatecli/updatecli.d/ubuntu-22-04-images.yaml @@ -0,0 +1,55 @@ +--- +name: Bump aws `ubuntu 22.04 AMD64` image version + +scms: + default: + kind: github + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + branch: "{{ .github.branch }}" + +sources: + lastReleaseVersion: + kind: shell + name: Get the latest `ubuntu 22.04 AMD64` AMI ID + spec: + command: > + aws ec2 describe-images \ + --owners 099720109477 \ + --filters \ + "Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-*-22.04-*-server-*" \ + "Name=root-device-type,Values=ebs" \ + "Name=virtualization-type,Values=hvm" \ + "Name=architecture,Values=x86_64" \ + --query 'sort_by(Images, &CreationDate)[-1].ImageId' \ + --region us-east-2 \ + --output text + environments: + - name: PATH + - name: AWS_ACCESS_KEY_ID + - name: AWS_SECRET_ACCESS_KEY + +targets: + updateVersion: + name: Update aws `ubuntu 22.04 AMD64` AMI ID in locals + sourceid: lastReleaseVersion + kind: yaml + scmid: default + spec: + file: ./images-versions.yaml + key: $.aws.ubuntu.'22.04'.amd64 + +actions: + default: + kind: github/pullrequest + scmid: default + spec: + title: Bump aws `ubuntu 22.04 AMD64` AMI ID + description: "Update AWS AMI ID for Ubuntu 22.04 AMD64" + labels: + - enhancement From a54d459a13e93baa67c25a75320c7142211307f6 Mon Sep 17 00:00:00 2001 From: jayfranco999 Date: Fri, 25 Oct 2024 12:45:52 +0530 Subject: [PATCH 2/2] fixup Signed-off-by: jayfranco999 --- ...{ubuntu-22-04-images.yaml => ubuntu-22-04-amd64-images.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename updatecli/updatecli.d/{ubuntu-22-04-images.yaml => ubuntu-22-04-amd64-images.yaml} (96%) diff --git a/updatecli/updatecli.d/ubuntu-22-04-images.yaml b/updatecli/updatecli.d/ubuntu-22-04-amd64-images.yaml similarity index 96% rename from updatecli/updatecli.d/ubuntu-22-04-images.yaml rename to updatecli/updatecli.d/ubuntu-22-04-amd64-images.yaml index d9020ac4d..66a7b8be2 100644 --- a/updatecli/updatecli.d/ubuntu-22-04-images.yaml +++ b/updatecli/updatecli.d/ubuntu-22-04-amd64-images.yaml @@ -1,5 +1,5 @@ --- -name: Bump aws `ubuntu 22.04 AMD64` image version +name: Bump aws `ubuntu 22.04 AMD64` AMI ID scms: default: