@@ -8,7 +8,10 @@ source "$SCRIPTPATH/docker_image_utils.sh"
8
8
9
9
10
10
submodule_path=" "
11
+ # the path to the registry for this project *with a trailing slash*
11
12
REGISTRY=" "
13
+ # the same, without
14
+ REGISTRY_WITHOUT_SLASH=" "
12
15
DOTENV_VAR_NAME=" "
13
16
REGISTRY_USER=" "
14
17
REGISTRY_PASSWORD=" "
@@ -32,6 +35,16 @@ print_help () {
32
35
IMGNAME=base_instance
33
36
IMGNAME_INSTANCE=instance
34
37
IMGNAME_MINIMAL_INSTANCE=minimal-instance
38
+ # For use in haf_api_node, we always tag the minimal instance with the top-level
39
+ # registry path for the project. Normally, CI_REGISTRY_IMAGE for that project,
40
+ # so registry.gitlab.syncad.com/hive/haf for this project.
41
+ # Ideally, we'd rename registry.gitlab.syncad.com/hive/haf/minimal-instance to
42
+ # registry.gitlab.syncad.com/hive/haf. I don't know if anything depends on
43
+ # the existence of an image named minimal-instance. For that reason,
44
+ # I'm just adding an additional tag that points to the same minimal-instance
45
+ # image. If it's determined to be safe, we should remove the tag for
46
+ # minimal-instance.
47
+ RETAG_MINIMAL_INSTANCE=1
35
48
36
49
while [ $# -gt 0 ]; do
37
50
case " $1 " in
@@ -44,11 +57,13 @@ while [ $# -gt 0 ]; do
44
57
IMGNAME=testnet-base_instance
45
58
IMGNAME_INSTANCE=testnet-instance
46
59
IMGNAME_MINIMAL_INSTANCE=testnet-minimal-instance
60
+ RETAG_MINIMAL_INSTANCE=0
47
61
;;
48
62
" mirrornet" * )
49
63
IMGNAME=mirrornet-base_instance
50
64
IMGNAME_INSTANCE=mirrornet-instance
51
65
IMGNAME_MINIMAL_INSTANCE=mirrornet-minimal-instance
66
+ RETAG_MINIMAL_INSTANCE=0
52
67
;;
53
68
" mainnet" * )
54
69
;;
@@ -73,6 +88,7 @@ while [ $# -gt 0 ]; do
73
88
elif [ -z " $REGISTRY " ];
74
89
then
75
90
REGISTRY=" ${1} "
91
+ REGISTRY_WITHOUT_SLASH=" $( echo " $1 " | sed ' s/\/$//' ) "
76
92
elif [ -z " $DOTENV_VAR_NAME " ];
77
93
then
78
94
DOTENV_VAR_NAME=${1}
@@ -127,6 +143,11 @@ else
127
143
time docker push " $img "
128
144
time docker push " $img_instance "
129
145
time docker push " $img_minimal_instance "
146
+ if [ " $RETAG_MINIMAL_INSTANCE " -eq 1 ]; then
147
+ echo " Retagging minimal-instance"
148
+ docker tag " $img_minimal_instance " " ${REGISTRY_WITHOUT_SLASH} :${short_commit} "
149
+ time docker push " ${REGISTRY_WITHOUT_SLASH} :${short_commit} "
150
+ fi
130
151
fi
131
152
132
153
echo " ${DOTENV_VAR_NAME} _IMAGE_NAME=$img " > docker_image_name.env
0 commit comments