2017-07-15 00:15:51 -07:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
|
|
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
2018-06-09 15:40:08 +02:00
|
|
|
# shellcheck disable=SC1090
|
2017-07-15 00:15:51 -07:00
|
|
|
source "${scriptdir}/../../build/common.sh"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case "${1:-}" in
|
2018-06-09 15:40:08 +02:00
|
|
|
save)
|
|
|
|
|
case "${2:-}" in
|
|
|
|
|
arm|arm64|amd64)
|
|
|
|
|
docker tag "${BUILD_REGISTRY}/ceph-$2:latest" rook/ceph:master
|
2018-11-19 04:31:45 +02:00
|
|
|
docker tag "${BUILD_REGISTRY}/cassandra-$2:latest" rook/cassandra:master
|
2018-08-14 20:23:04 +00:00
|
|
|
docker tag "${BUILD_REGISTRY}/nfs-$2:latest" rook/nfs:master
|
2019-08-14 19:54:05 +05:30
|
|
|
docker tag "${BUILD_REGISTRY}/yugabytedb-$2:latest" rook/yugabytedb:master
|
2018-06-09 15:40:08 +02:00
|
|
|
if [ ! -z "$3" ]
|
2017-08-24 14:55:01 -07:00
|
|
|
then
|
2018-06-09 15:40:08 +02:00
|
|
|
docker tag "${BUILD_REGISTRY}/ceph-$2:latest" "rook/ceph:$3"
|
2018-10-02 15:43:53 -06:00
|
|
|
docker save -o "ceph-$2.tar" rook/ceph:master "rook/ceph:$3"
|
2018-11-19 04:31:45 +02:00
|
|
|
docker tag "${BUILD_REGISTRY}/cassandra-$2:latest" "rook/cassandra:$3"
|
|
|
|
|
docker save -o "cassandra-$2.tar" rook/cassandra:master "rook/cassandra:$3"
|
2018-08-14 20:23:04 +00:00
|
|
|
docker tag "${BUILD_REGISTRY}/nfs-$2:latest" "rook/nfs:$3"
|
|
|
|
|
docker save -o "nfs-$2.tar" rook/nfs:master "rook/nfs:$3"
|
2019-08-14 19:54:05 +05:30
|
|
|
docker tag "${BUILD_REGISTRY}/yugabytedb-$2:latest" "rook/yugabytedb:$3"
|
|
|
|
|
docker save -o "yugabytedb-$2.tar" rook/yugabytedb:master "rook/yugabytedb:$3"
|
2017-08-24 14:55:01 -07:00
|
|
|
else
|
2018-10-02 15:43:53 -06:00
|
|
|
docker save -o "ceph-$2.tar" rook/ceph:master
|
2018-11-19 04:31:45 +02:00
|
|
|
docker save -o "cassandra-$2.tar" rook/cassandra:master
|
2018-08-14 20:23:04 +00:00
|
|
|
docker save -o "nfs-$2.tar" rook/nfs:master
|
2019-08-14 19:54:05 +05:30
|
|
|
docker save -o "yugabytedb-$2.tar" rook/yugabytedb:master
|
2018-06-09 15:40:08 +02:00
|
|
|
fi
|
2019-08-14 19:54:05 +05:30
|
|
|
|
|
|
|
|
echo "Saved docker images in archives: $(ls | grep tar)"
|
2018-06-09 15:40:08 +02:00
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo "usage :" >&2
|
|
|
|
|
echo "$0 $1 [arm|arm64|amd64] [new_tag]" >&2
|
|
|
|
|
esac
|
|
|
|
|
;;
|
|
|
|
|
load)
|
|
|
|
|
case "${2:-}" in
|
|
|
|
|
arm|arm64|amd64)
|
2019-08-14 19:54:05 +05:30
|
|
|
echo "Loading archived images to docker: $(ls | grep tar)"
|
|
|
|
|
|
2018-06-09 15:40:08 +02:00
|
|
|
docker load -i "ceph-$2.tar"
|
2018-11-19 04:31:45 +02:00
|
|
|
docker load -i "cassandra-$2.tar"
|
2018-08-14 20:23:04 +00:00
|
|
|
docker load -i "nfs-$2.tar"
|
2019-08-14 19:54:05 +05:30
|
|
|
docker load -i "yugabytedb-$2.tar"
|
2018-06-09 15:40:08 +02:00
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo "usage :" >&2
|
|
|
|
|
echo "$0 $1 [arm|arm64|amd64]" >&2
|
2017-07-15 00:15:51 -07:00
|
|
|
|
2018-06-09 15:40:08 +02:00
|
|
|
esac
|
|
|
|
|
;;
|
|
|
|
|
tag)
|
|
|
|
|
case "${2:- }" in
|
|
|
|
|
arm|arm64|amd64)
|
|
|
|
|
tag_version="${3:-"master"}"
|
|
|
|
|
docker tag "${BUILD_REGISTRY}/ceph-$2:latest" "rook/ceph:${tag_version}"
|
2018-11-19 04:31:45 +02:00
|
|
|
docker tag "${BUILD_REGISTRY}/cassandra-$2:latest" "rook/cassandra:${tag_version}"
|
2018-08-14 20:23:04 +00:00
|
|
|
docker tag "${BUILD_REGISTRY}/nfs-$2:latest" "rook/nfs:${tag_version}"
|
2019-08-14 19:54:05 +05:30
|
|
|
docker tag "${BUILD_REGISTRY}/yugabytedb-$2:latest" "rook/yugabytedb:${tag_version}"
|
2018-06-09 15:40:08 +02:00
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo "usage :" >&2
|
|
|
|
|
echo "$0 $1 [arm|arm64|amd64] [new_tag]" >&2
|
|
|
|
|
esac
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo "usage:" >&2
|
|
|
|
|
echo " $0 save [arm|arm64|amd64] [new_tag]" >&2
|
|
|
|
|
echo " $0 load [arm|arm64|amd64]" >&2
|
|
|
|
|
echo " $0 tag [arm|arm64|amd64] [new_tag]" >&2
|
2017-07-15 00:15:51 -07:00
|
|
|
esac
|