Skip to content

Commit 11cd577

Browse files
committed
After regular CI builds, retag the /hive/hive/minimal-instance image
to /hive/hive. Not important in and of itself, but the haf build shares the same building/tagging script, and the name of the haf minimal instance is important for haf_api_nod
1 parent d7f5831 commit 11cd577

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

scripts/ci-helpers/get_image4submodule.sh

+21
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ source "$SCRIPTPATH/docker_image_utils.sh"
88

99

1010
submodule_path=""
11+
# the path to the registry for this project *with a trailing slash*
1112
REGISTRY=""
13+
# the same, without
14+
REGISTRY_WITHOUT_SLASH=""
1215
DOTENV_VAR_NAME=""
1316
REGISTRY_USER=""
1417
REGISTRY_PASSWORD=""
@@ -32,6 +35,16 @@ print_help () {
3235
IMGNAME=base_instance
3336
IMGNAME_INSTANCE=instance
3437
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
3548

3649
while [ $# -gt 0 ]; do
3750
case "$1" in
@@ -44,11 +57,13 @@ while [ $# -gt 0 ]; do
4457
IMGNAME=testnet-base_instance
4558
IMGNAME_INSTANCE=testnet-instance
4659
IMGNAME_MINIMAL_INSTANCE=testnet-minimal-instance
60+
RETAG_MINIMAL_INSTANCE=0
4761
;;
4862
"mirrornet"*)
4963
IMGNAME=mirrornet-base_instance
5064
IMGNAME_INSTANCE=mirrornet-instance
5165
IMGNAME_MINIMAL_INSTANCE=mirrornet-minimal-instance
66+
RETAG_MINIMAL_INSTANCE=0
5267
;;
5368
"mainnet"*)
5469
;;
@@ -73,6 +88,7 @@ while [ $# -gt 0 ]; do
7388
elif [ -z "$REGISTRY" ];
7489
then
7590
REGISTRY="${1}"
91+
REGISTRY_WITHOUT_SLASH="$(echo "$1" | sed 's/\/$//')"
7692
elif [ -z "$DOTENV_VAR_NAME" ];
7793
then
7894
DOTENV_VAR_NAME=${1}
@@ -127,6 +143,11 @@ else
127143
time docker push "$img"
128144
time docker push "$img_instance"
129145
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
130151
fi
131152

132153
echo "${DOTENV_VAR_NAME}_IMAGE_NAME=$img" > docker_image_name.env

0 commit comments

Comments
 (0)