2018-05-17 07:11:59 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Fetch images used for e2e testing
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
2023-02-23 09:41:54 -05:00
|
|
|
alpine_src=alpine@sha256:69665d02cb32192e52e07644d76bc6f25abeb5410edc1c7a81a10ba3f0efb90a
|
2023-02-23 09:00:59 -05:00
|
|
|
alpine_dest=registry:5000/alpine:frozen
|
2018-05-17 07:11:59 -04:00
|
|
|
|
|
|
|
busybox_src=busybox@sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7
|
2023-02-23 09:00:59 -05:00
|
|
|
busybox_dest=registry:5000/busybox:frozen
|
2018-05-17 07:11:59 -04:00
|
|
|
|
2019-02-26 06:09:21 -05:00
|
|
|
fetch_tag_image() {
|
|
|
|
docker pull "$1"
|
|
|
|
docker tag "$1" "$2"
|
2018-05-17 07:11:59 -04:00
|
|
|
}
|
|
|
|
|
2019-02-26 06:09:21 -05:00
|
|
|
push_image() {
|
|
|
|
docker push "$1"
|
2018-05-17 07:11:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
cmd=${1-}
|
|
|
|
case "$cmd" in
|
|
|
|
alpine)
|
|
|
|
fetch_tag_image "$alpine_src" "$alpine_dest"
|
|
|
|
push_image "$alpine_dest"
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
busybox)
|
|
|
|
fetch_tag_image "$busybox_src" "$busybox_dest"
|
|
|
|
push_image "$busybox_dest"
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
all|"")
|
|
|
|
fetch_tag_image "$alpine_src" "$alpine_dest"
|
|
|
|
push_image "$alpine_dest"
|
|
|
|
fetch_tag_image "$busybox_src" "$busybox_dest"
|
|
|
|
push_image "$busybox_dest"
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
fetch-only)
|
|
|
|
fetch_tag_image "$alpine_src" "$alpine_dest"
|
|
|
|
fetch_tag_image "$busybox_src" "$busybox_dest"
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unknown command: $cmd"
|
|
|
|
echo "Usage:"
|
|
|
|
echo " $0 [alpine | busybox | all | fetch-only]"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|