|
12 | 12 | * This script prints a literal preamble (stages, job templates), then loops |
13 | 13 | * over the parsed compose services to emit, per Linux OS, one build matrix job |
14 | 14 | * over PHP versions (bake builds and pushes the multi-arch image, then ddsign |
15 | | - * signs it) plus a manual publish matrix job that mirrors the tags to Docker |
16 | | - * Hub. Windows is emitted the same way but single-arch (no manifest) with its |
| 15 | + * signs it) plus a manual publish matrix job that mirrors the tags to the public |
| 16 | + * registries. Windows is emitted the same way but single-arch (no manifest) with its |
17 | 17 | * own build runner/script; its images are signed by a separate Linux job |
18 | 18 | * (ddsign has no Windows binary), see .image_sign. |
19 | 19 | */ |
@@ -126,24 +126,36 @@ function parse_compose(string $path, array $env): array |
126 | 126 | # pod uses cluster defaults. MAKE_JOBS sets the builder's compile parallelism. |
127 | 127 | MAKE_JOBS: "8" |
128 | 128 |
|
| 129 | +# Mirrors an existing registry.ddbuild.io tag to the public registries via |
| 130 | +# artifact-gateway. tags: is required — this replaced a trigger/bridge job, which |
| 131 | +# needed no runner, and neither the parent pipeline nor this generated child sets |
| 132 | +# a `default:`. |
129 | 133 | .image_publish: |
130 | 134 | stage: ci-publish |
131 | 135 | rules: |
132 | 136 | - when: manual |
133 | 137 | allow_failure: true |
134 | 138 | # No deps: a publish just mirrors whatever already exists in |
135 | | - # registry.ddbuild.io to Docker Hub, so it can run without (re)building. |
| 139 | + # registry.ddbuild.io, so it can run without (re)building. |
136 | 140 | needs: [] |
137 | | - trigger: |
138 | | - project: DataDog/public-images |
139 | | - branch: main |
140 | | - strategy: depend |
| 141 | + image: registry.ddbuild.io/agent-delivery/dd-pkg:v0.9.3 |
| 142 | + tags: ["arch:arm64"] |
141 | 143 | # $TAG is supplied per matrix entry by the generated publish jobs. |
142 | 144 | variables: |
143 | | - IMG_REGISTRIES: "dockerhub" |
144 | | - IMG_SIGNING: false |
| 145 | + IMG_REGISTRIES: "public" |
| 146 | + IMG_SIGNING: "false" |
145 | 147 | IMG_SOURCES: "${CI_REGISTRY_IMAGE}:${TAG}" |
146 | 148 | IMG_DESTINATIONS: "dd-trace-ci:${TAG}" |
| 149 | + PUBLIC_IMAGES_PUBLISH_TIMEOUT: "1800" |
| 150 | + script: |
| 151 | + - | |
| 152 | + set -euo pipefail |
| 153 | + dd-pkg version |
| 154 | + args=(publish-image --timeout "${PUBLIC_IMAGES_PUBLISH_TIMEOUT}" --poll-interval 30 --signing="${IMG_SIGNING}") |
| 155 | + if [[ -n "${IMG_REGISTRIES:-}" ]]; then args+=(--registries "${IMG_REGISTRIES}"); fi |
| 156 | + if [[ -n "${IMG_SOURCES:-}" ]]; then args+=(--sources "${IMG_SOURCES}"); fi |
| 157 | + if [[ -n "${IMG_DESTINATIONS:-}" ]]; then args+=(--destinations "${IMG_DESTINATIONS}"); fi |
| 158 | + dd-pkg "${args[@]}" |
147 | 159 |
|
148 | 160 | # Signs an already-pushed tag in registry.ddbuild.io. Used for the Windows |
149 | 161 | # images: they're built without buildx (see .windows_image_build), so unlike |
|
0 commit comments