From 18908aa65fef557c4222671baaca9abba7371b4c Mon Sep 17 00:00:00 2001 From: jayfranco999 Date: Mon, 11 Nov 2024 20:51:00 +0530 Subject: [PATCH 1/8] chore(updatecli):Track images Signed-off-by: jayfranco999 --- build-jenkins-agent-ubuntu.pkr.hcl | 1 + .../az-ubuntu-22-04-amd64-images.yml | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml diff --git a/build-jenkins-agent-ubuntu.pkr.hcl b/build-jenkins-agent-ubuntu.pkr.hcl index 3ed72fde5..4fc58a078 100644 --- a/build-jenkins-agent-ubuntu.pkr.hcl +++ b/build-jenkins-agent-ubuntu.pkr.hcl @@ -17,6 +17,7 @@ build { image_publisher = "canonical" # List available SKUs with the command `az vm image list-skus --offer 0001-com-ubuntu-server-jammy --location eastus --publisher canonical --output table` image_sku = local.az_instance_image_sku[var.architecture] + image_version = try(local.images_versions["azure"]["ubuntu"][var.agent_os_version][var.architecture], "N/A") os_type = "Linux" } diff --git a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml new file mode 100644 index 000000000..70c90cdf5 --- /dev/null +++ b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml @@ -0,0 +1,49 @@ +--- +name: Bump azure `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 image version from Azure + spec: + command: az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID > /dev/null && az vm image list --location eastus --publisher Canonical --offer UbuntuServer --sku 22.04-LTS --all --query "[?sku=='22.04-LTS'].version" -o tsv | sort -u | tail -n 1 + environments: + - name: PATH + - name: AZURE_CLIENT_ID + - name: AZURE_CLIENT_SECRET + - name: AZURE_TENANT_ID + +targets: + updateVersion: + name: Update azure `ubuntu 22.04` amd64 image version in locals + sourceid: lastReleaseVersion + kind: yaml + scmid: default + spec: + file: ./images-versions.yaml + key: $.azure.ubuntu."22.04".amd64 + transformers: + - addprefix: '"' + - addsuffix: '"' + +actions: + default: + kind: github/pullrequest + scmid: default + spec: + title: Bump azure `ubuntu 22.04` amd64 image version + description: "Update the latest Azure Ubuntu 22.04 amd64 image version in the images-versions.yaml file." + labels: + - enhancement \ No newline at end of file From 772caca5e7917093d6dcf6272c9cfc9455d13920 Mon Sep 17 00:00:00 2001 From: jayfranco999 Date: Mon, 11 Nov 2024 20:54:48 +0530 Subject: [PATCH 2/8] fixup Signed-off-by: jayfranco999 --- updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml index 70c90cdf5..ef52bb843 100644 --- a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml +++ b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml @@ -33,7 +33,7 @@ targets: scmid: default spec: file: ./images-versions.yaml - key: $.azure.ubuntu."22.04".amd64 + key: $.azure.ubuntu.'22.04'.amd64 transformers: - addprefix: '"' - addsuffix: '"' From 4d95628ddcd74f0ea2108f031f35d26ed504b05d Mon Sep 17 00:00:00 2001 From: jayfranco999 Date: Mon, 11 Nov 2024 21:08:55 +0530 Subject: [PATCH 3/8] fixup Signed-off-by: jayfranco999 --- updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml index ef52bb843..f3c3918a7 100644 --- a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml +++ b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml @@ -18,7 +18,7 @@ sources: kind: shell name: Get the latest `ubuntu 22.04` amd64 image version from Azure spec: - command: az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID > /dev/null && az vm image list --location eastus --publisher Canonical --offer UbuntuServer --sku 22.04-LTS --all --query "[?sku=='22.04-LTS'].version" -o tsv | sort -u | tail -n 1 + command: az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID > /dev/null && az vm image list --location eastus --publisher Canonical --offer UbuntuServer --sku 22.04-LTS-AMD64 --all --query "[?sku=='22.04-LTS-AMD64'].version" -o tsv | sort -u | tail -n 1 environments: - name: PATH - name: AZURE_CLIENT_ID @@ -46,4 +46,4 @@ actions: title: Bump azure `ubuntu 22.04` amd64 image version description: "Update the latest Azure Ubuntu 22.04 amd64 image version in the images-versions.yaml file." labels: - - enhancement \ No newline at end of file + - enhancement From 5bebcf59284ddb4fc0bf88b2837c09dbf64efe61 Mon Sep 17 00:00:00 2001 From: jayfranco999 Date: Mon, 11 Nov 2024 21:22:00 +0530 Subject: [PATCH 4/8] fixup Signed-off-by: jayfranco999 --- updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml index f3c3918a7..a0e74eac6 100644 --- a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml +++ b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml @@ -18,7 +18,7 @@ sources: kind: shell name: Get the latest `ubuntu 22.04` amd64 image version from Azure spec: - command: az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID > /dev/null && az vm image list --location eastus --publisher Canonical --offer UbuntuServer --sku 22.04-LTS-AMD64 --all --query "[?sku=='22.04-LTS-AMD64'].version" -o tsv | sort -u | tail -n 1 + command: az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID > /dev/null && az vm image list --location eastus --publisher Canonical --offer 0001-com-ubuntu-server-jammy --sku 22.04-AMD64 --all --query "[?sku=='22.04-AMD64'].version" -o tsv | sort -u | tail -n 1 environments: - name: PATH - name: AZURE_CLIENT_ID From 8c2e8686892734c18758d630148d18935f2d360b Mon Sep 17 00:00:00 2001 From: jayfranco999 Date: Tue, 26 Nov 2024 15:29:14 +0530 Subject: [PATCH 5/8] fixup Signed-off-by: jayfranco999 --- updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml index a0e74eac6..a01c4f900 100644 --- a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml +++ b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml @@ -18,7 +18,7 @@ sources: kind: shell name: Get the latest `ubuntu 22.04` amd64 image version from Azure spec: - command: az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID > /dev/null && az vm image list --location eastus --publisher Canonical --offer 0001-com-ubuntu-server-jammy --sku 22.04-AMD64 --all --query "[?sku=='22.04-AMD64'].version" -o tsv | sort -u | tail -n 1 + command: az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID > /dev/null && az vm image list --location eastus --publisher Canonical --offer 0001-com-ubuntu-server-jammy --sku 22_04-AMD64-lts-gen2 --all --query "[?offer=='0001-com-ubuntu-server-jammy'].version" -o tsv | sort -u | tail -n 1 environments: - name: PATH - name: AZURE_CLIENT_ID From 47cf6c0b31451dec5345b57427625f85b169e762 Mon Sep 17 00:00:00 2001 From: jayfranco999 Date: Tue, 26 Nov 2024 15:39:48 +0530 Subject: [PATCH 6/8] fixup Signed-off-by: jayfranco999 --- updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml index a01c4f900..ec4f5c59f 100644 --- a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml +++ b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml @@ -18,7 +18,7 @@ sources: kind: shell name: Get the latest `ubuntu 22.04` amd64 image version from Azure spec: - command: az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID > /dev/null && az vm image list --location eastus --publisher Canonical --offer 0001-com-ubuntu-server-jammy --sku 22_04-AMD64-lts-gen2 --all --query "[?offer=='0001-com-ubuntu-server-jammy'].version" -o tsv | sort -u | tail -n 1 + command: az login --service-principal -u $AZURE_CLIENT_ID -p $AZURE_CLIENT_SECRET --tenant $AZURE_TENANT_ID > /dev/null && az vm image list --location eastus --publisher Canonical --offer 0001-com-ubuntu-server-jammy --sku 22_04-lts-gen2 --all --query "[?offer=='0001-com-ubuntu-server-jammy'].version" -o tsv | sort -u | tail -n 1 environments: - name: PATH - name: AZURE_CLIENT_ID From e8ae5e33176d555ebfc3af1a9c72469234465959 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Tue, 26 Nov 2024 11:24:38 +0100 Subject: [PATCH 7/8] Update updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml --- updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml index ec4f5c59f..cddfe165b 100644 --- a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml +++ b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml @@ -47,3 +47,4 @@ actions: description: "Update the latest Azure Ubuntu 22.04 amd64 image version in the images-versions.yaml file." labels: - enhancement + - ubuntu From af5fe56bf0b58dd5d2dab86543f984d3671f05ae Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Tue, 26 Nov 2024 11:24:44 +0100 Subject: [PATCH 8/8] Update updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml --- updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml index cddfe165b..7d99af09d 100644 --- a/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml +++ b/updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml @@ -43,7 +43,7 @@ actions: kind: github/pullrequest scmid: default spec: - title: Bump azure `ubuntu 22.04` amd64 image version + title: Bump Azure Ubuntu `22.04` amd64 image version description: "Update the latest Azure Ubuntu 22.04 amd64 image version in the images-versions.yaml file." labels: - enhancement