Skip to content

Commit ea70952

Browse files
authored
ci: publish fips images as tags to dockerhub (#41486)
1 parent 8d4507d commit ea70952

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,33 +1187,39 @@ jobs:
11871187
11881188
echo "Promoting $service"
11891189
1190-
if [[ "${service}" == 'rocketchat' ]]; then
1191-
IMAGE_NAME="${{ needs.release-versions.outputs.lowercase-repo }}/rocket.chat"
1192-
else
1193-
IMAGE_NAME="${{ needs.release-versions.outputs.lowercase-repo }}/${service}"
1194-
fi
1195-
1190+
# FIPS images publish to the same repo as their base service, distinguished by a
1191+
# '-fips' tag suffix (matching GHCR), not a separate '-fips' repository.
11961192
# Get image name from docker-compose-ci.yml since rocketchat image is different from service name (rocket.chat)
1193+
TAG_SUFFIX=''
11971194
if [[ "$service" == *"-fips" ]]; then
11981195
base_service="${service%-fips}"
1196+
TAG_SUFFIX='-fips'
11991197
SRC=$(docker compose -f docker-compose-ci.yml -f docker-compose-ci.fips.yml config --format json 2>/dev/null | jq -r --arg s "$base_service" '.services[$s].image')
12001198
else
1201-
SRC=$(docker compose -f docker-compose-ci.yml config --format json 2>/dev/null | jq -r --arg s "${service}" '.services[$s].image')
1199+
base_service="$service"
1200+
SRC=$(docker compose -f docker-compose-ci.yml config --format json 2>/dev/null | jq -r --arg s "$service" '.services[$s].image')
12021201
fi
1202+
1203+
if [[ "${base_service}" == 'rocketchat' ]]; then
1204+
IMAGE_NAME="${{ needs.release-versions.outputs.lowercase-repo }}/rocket.chat"
1205+
else
1206+
IMAGE_NAME="${{ needs.release-versions.outputs.lowercase-repo }}/${base_service}"
1207+
fi
1208+
12031209
DEST_REPO="docker.io/${IMAGE_NAME}"
12041210
1205-
echo "Copying $SRC to ${DEST_REPO}:${PRIMARY}"
1211+
echo "Copying $SRC to ${DEST_REPO}:${PRIMARY}${TAG_SUFFIX}"
12061212
skopeo copy --all \
12071213
"docker://${SRC}" \
1208-
"docker://${DEST_REPO}:${PRIMARY}"
1214+
"docker://${DEST_REPO}:${PRIMARY}${TAG_SUFFIX}"
12091215
12101216
# copy additional tags
12111217
if (( ${#TAGS[@]} > 1 )); then
12121218
for t in "${TAGS[@]:1}"; do
1213-
echo "Copying $SRC to ${DEST_REPO}:${t}"
1219+
echo "Copying $SRC to ${DEST_REPO}:${t}${TAG_SUFFIX}"
12141220
skopeo copy --all \
12151221
"docker://${SRC}" \
1216-
"docker://${DEST_REPO}:${t}"
1222+
"docker://${DEST_REPO}:${t}${TAG_SUFFIX}"
12171223
done
12181224
fi
12191225

0 commit comments

Comments
 (0)