Skip to content

Commit b4e6ac7

Browse files
author
Matthias Koeppe
committed
.github/workflows/docker.yml: Show Docker images as annotations, show instructions
1 parent 5537a82 commit b4e6ac7

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

.github/workflows/docker.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,32 @@ jobs:
260260
run: |
261261
.github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME"
262262
if: always()
263-
- name: List docker images
263+
- name: List Docker images
264264
run: |
265-
if [ -f .tox/$TOX_ENV/Dockertags ]; then
266-
cat .tox/$TOX_ENV/Dockertags
265+
if [ -n "$DOCKER_PUSH_REPOSITORY" -a -f .tox/$TOX_ENV/Dockertags ]; then
266+
echo "::notice title=Docker images pushed::$(echo $(cat .tox/$TOX_ENV/Dockertags))"
267+
echo
268+
echo "To pull an image and enter the container, type:"
269+
echo
270+
for TAG in $(cat .tox/$TOX_ENV/Dockertags); do
271+
echo " \$ docker run -it $TAG bash"
272+
done
273+
echo
274+
echo "To use an image as the base for an incremental build, type:"
275+
echo
276+
TOX_ENV_SANS_INCREMENTAL=${TOX_ENV/-incremental/}
277+
DOCKER_IMAGE=${TOX_ENV_SANS_INCREMENTAL#docker-}
278+
for TAG in $(cat .tox/$TOX_ENV/Dockertags); do
279+
echo -n " \$"
280+
if [ "$DOCKER_PUSH_REPOSITORY" != "ghcr.io/sagemath/sage/" ]; then
281+
echo -n " FROM_DOCKER_REPOSITORY=$DOCKER_PUSH_REPOSITORY"
282+
fi
283+
eval DOCKER_TARGET=\${TAG#*$DOCKER_IMAGE-}
284+
DOCKER_TARGET=${DOCKER_TARGET%:*}
285+
if [ "$DOCKER_TARGET" != "with-targets" ]; then
286+
echo -n " FROM_DOCKER_TARGET=$DOCKER_TARGET"
287+
fi
288+
echo " FROM_DOCKER_TAG=${TAG#*:} tox -e $TOX_ENV_SANS_INCREMENTAL-incremental"
289+
done
267290
fi
268291
if: always()

0 commit comments

Comments
 (0)