Skip to content

Commit 0a1bd99

Browse files
authored
Merge branch 'master' into monthly
2 parents 579be71 + 27c943b commit 0a1bd99

3 files changed

Lines changed: 22 additions & 18 deletions

File tree

roles/generate-jenkins/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ armhf_native: false
6060
build_armhf: false
6161
image_provenance: true
6262
image_sbom: true
63+
image_builder: 'container'

roles/generate-jenkins/templates/EXTERNAL_TRIGGER.j2

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,25 @@ jobs:
108108
"https://ghcr.io/token?scope=repository%3A{{ better_vars.LS_USER }}%2F{{ project_name }}%3Apull" \
109109
| jq -r '.token')
110110
{% if better_vars.MULTIARCH == 'true' %}
111-
multidigest=$(curl -s \
112-
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
113-
--header "Authorization: Bearer ${token}" \
114-
"https://ghcr.io/v2/${image}/manifests/${tag}" \
115-
| jq -r 'first(.manifests[].digest)')
116-
digest=$(curl -s \
117-
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
118-
--header "Authorization: Bearer ${token}" \
119-
"https://ghcr.io/v2/${image}/manifests/${multidigest}" \
120-
| jq -r '.config.digest')
111+
multidigest=$(curl -s \
112+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
113+
--header "Accept: application/vnd.oci.image.index.v1+json" \
114+
--header "Authorization: Bearer ${token}" \
115+
"https://ghcr.io/v2/${image}/manifests/${tag}")
116+
multidigest=$(jq -r ".manifests[] | select(.platform.architecture == \"amd64\").digest?" <<< "${multidigest}")
117+
digest=$(curl -s \
118+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
119+
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
120+
--header "Authorization: Bearer ${token}" \
121+
"https://ghcr.io/v2/${image}/manifests/${multidigest}" \
122+
| jq -r '.config.digest')
121123
{% else %}
122-
digest=$(curl -s \
123-
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
124-
--header "Authorization: Bearer ${token}" \
125-
"https://ghcr.io/v2/${image}/manifests/${tag}" \
126-
| jq -r '.config.digest')
124+
digest=$(curl -s \
125+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
126+
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
127+
--header "Authorization: Bearer ${token}" \
128+
"https://ghcr.io/v2/${image}/manifests/${tag}" \
129+
| jq -r '.config.digest')
127130
{% endif %}
128131
image_info=$(curl -sL \
129132
--header "Authorization: Bearer ${token}" \

roles/generate-jenkins/templates/Jenkinsfile.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ pipeline {
791791
--label \"org.opencontainers.image.title={{ project_name|capitalize }}\" \
792792
--label \"org.opencontainers.image.description={% if project_blurb is defined %}{{ project_blurb | replace('"', '') | replace('\n', ' ') }}{% else %}{{ project_name }} image by {{ lsio_project_name }}{% endif %}\" \
793793
--no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \
794-
--provenance={{ image_provenance | lower }} --sbom={{ image_sbom | lower }} --builder=container --load \
794+
--provenance={{ image_provenance | lower }} --sbom={{ image_sbom | lower }} --builder={{ image_builder }} --load \
795795
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
796796
sh '''#! /bin/bash
797797
set -e
@@ -859,7 +859,7 @@ pipeline {
859859
--label \"org.opencontainers.image.title={{ project_name|capitalize }}\" \
860860
--label \"org.opencontainers.image.description={% if project_blurb is defined %}{{ project_blurb | replace('"', '') | replace('\n', ' ') }}{% else %}{{ project_name }} image by {{ lsio_project_name }}{% endif %}\" \
861861
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \
862-
--provenance={{ image_provenance | lower }} --sbom={{ image_sbom | lower }} --builder=container --load \
862+
--provenance={{ image_provenance | lower }} --sbom={{ image_sbom | lower }} --builder={{ image_builder }} --load \
863863
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
864864
sh '''#! /bin/bash
865865
set -e
@@ -922,7 +922,7 @@ pipeline {
922922
--label \"org.opencontainers.image.title={{ project_name|capitalize }}\" \
923923
--label \"org.opencontainers.image.description={% if project_blurb is defined %}{{ project_blurb | replace('"', '') | replace('\n', ' ') }}{% else %}{{ project_name }} image by {{ lsio_project_name }}{% endif %}\" \
924924
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \
925-
--provenance={{ image_provenance | lower }} --sbom={{ image_sbom | lower }} --builder=container --load \
925+
--provenance={{ image_provenance | lower }} --sbom={{ image_sbom | lower }} --builder={{ image_builder }} --load \
926926
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
927927
sh '''#! /bin/bash
928928
set -e

0 commit comments

Comments
 (0)