forked from astrolabsoftware/fink-broker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
push-image.sh
executable file
·52 lines (39 loc) · 894 Bytes
/
push-image.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
# Push image to Docker Hub or load it inside kind
# @author Fabrice Jammes, IN2P3
set -euxo pipefail
DIR=$(cd "$(dirname "$0")"; pwd -P)
. "$CIUXCONFIG"
set -e
usage() {
cat << EOD
Usage: `basename $0` [options] path host [host ...]
Available options:
-h this message
-k development mode: load image in kind
-d do not push image to remote registry
Push image to remote registry and/or load it inside kind
EOD
}
kind=false
registry=true
# get the options
while getopts dhk c ; do
case $c in
h) usage ; exit 0 ;;
k) kind=true ;;
d) registry=false ;;
\?) usage ; exit 2 ;;
esac
done
shift `expr $OPTIND - 1`
if [ $# -ne 0 ] ; then
usage
exit 2
fi
if [ $kind = true ]; then
kind load docker-image "$CIUX_IMAGE_URL"
fi
if [ $registry = true ]; then
docker push "$CIUX_IMAGE_URL"
fi