Skip to content

Commit

Permalink
chore(updatecli):Track docker image digests for ubuntu 22_04 AMD64
Browse files Browse the repository at this point in the history
…and `ubuntu 22_04 ARM64` (#1508)

* chore(updatecli):Track docker image digests for ubuntu 22_04 AMD64 and ARM64

Signed-off-by: jayfranco999 <jaideepfrancis999@gmail.com>

* fixup

Signed-off-by: jayfranco999 <jaideepfrancis999@gmail.com>

* fixup

Signed-off-by: jayfranco999 <jaideepfrancis999@gmail.com>

---------

Signed-off-by: jayfranco999 <jaideepfrancis999@gmail.com>
Co-authored-by: Damien Duportal <damien.duportal@gmail.com>
  • Loading branch information
jayfranco999 and dduportal authored Nov 13, 2024
1 parent b6178d7 commit 9697076
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 1 deletion.
5 changes: 5 additions & 0 deletions images-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ aws:
"22.04":
amd64: ami-00eb69d236edcfaf8
arm64: ami-039e419d24a37cb82
docker:
ubuntu:
"22.04":
amd64: sha256:3d1556a8a18cf5307b121e0a98e93f1ddf1f3f8e092f1fddfd941254785b95d7
arm64: sha256:7c75ab2b0567edbb9d4834a2c51e462ebd709740d1f2c40bcd23c56e974fe2a8
2 changes: 1 addition & 1 deletion sources.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ source "azure-arm" "base" {

# This source defines all the common settings for any Azure image (whatever Operating System)
source "docker" "base" {
image = "${var.agent_os_type}:${var.agent_os_version}"
image = try("${var.agent_os_type}@${local.images_versions["docker"]["ubuntu"][var.agent_os_version][var.architecture]}", "N/A")

# Persist image on local docker engine
commit = true
Expand Down
44 changes: 44 additions & 0 deletions updatecli/updatecli.d/docker-ubuntu-22-04-amd64-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Bump docker `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:
lastDockerDigest:
kind: dockerdigest
spec:
image: "ubuntu"
tag: "22.04"
architecture: "amd64"

targets:
updateDigest:
name: Update docker `ubuntu 22_04 amd64` image version in locals
sourceid: lastDockerDigest
kind: yaml
scmid: default
spec:
file: ./images-versions.yaml
key: $.docker.ubuntu.'22.04'.amd64
transformers:
- trimprefix: '22.04@'

actions:
default:
kind: github/pullrequest
scmid: default
spec:
title: Bump docker `ubuntu 22_04 amd64` image version
description: "Follow up docker images for ubuntu 22_04 amd64"
labels:
- enhancement
44 changes: 44 additions & 0 deletions updatecli/updatecli.d/docker-ubuntu-22-04-arm64-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Bump docker `ubuntu 22_04 arm64` 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:
lastDockerDigest:
kind: dockerdigest
spec:
image: "ubuntu"
tag: "22.04"
architecture: "arm64"

targets:
updateDigest:
name: Update docker `ubuntu 22_04 arm64` image version in locals
sourceid: lastDockerDigest
kind: yaml
scmid: default
spec:
file: ./images-versions.yaml
key: $.docker.ubuntu.'22.04'.arm64
transformers:
- trimprefix: '22.04@'

actions:
default:
kind: github/pullrequest
scmid: default
spec:
title: Bump docker `ubuntu 22_04 arm64` image version
description: "Follow up docker images for ubuntu 22_04 arm64"
labels:
- enhancement

0 comments on commit 9697076

Please sign in to comment.