Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(updatecli):Track ubuntu 22_04 AMD64 AZ images #1507

Merged
merged 8 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build-jenkins-agent-ubuntu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
dduportal marked this conversation as resolved.
Show resolved Hide resolved
os_type = "Linux"
}

Expand Down
49 changes: 49 additions & 0 deletions updatecli/updatecli.d/az-ubuntu-22-04-amd64-images.yml
Original file line number Diff line number Diff line change
@@ -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 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
- 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: '"'
dduportal marked this conversation as resolved.
Show resolved Hide resolved

actions:
default:
kind: github/pullrequest
scmid: default
spec:
title: Bump azure `ubuntu 22.04` amd64 image version
dduportal marked this conversation as resolved.
Show resolved Hide resolved
description: "Update the latest Azure Ubuntu 22.04 amd64 image version in the images-versions.yaml file."
labels:
- enhancement
dduportal marked this conversation as resolved.
Show resolved Hide resolved