@@ -30,14 +30,15 @@ GO_VERSION="$(go list -m -f '{{.GoVersion}}')"
30
30
function build_images {
31
31
local test_setup=$1
32
32
local uninstrumented_node_dockerfile=$2
33
- local node_only=${3:- }
33
+ local image_prefix=$3
34
+ local node_only=${4:- }
34
35
35
36
# Define image names
36
37
local base_image_name=" antithesis-${test_setup} "
37
38
local avalanchego_node_image_name=" antithesis-avalanchego-node:${TAG} "
38
- if [[ -n " ${IMAGE_PREFIX } " ]]; then
39
- base_image_name=" ${IMAGE_PREFIX } /${base_image_name} "
40
- avalanchego_node_image_name=" ${IMAGE_PREFIX } /${avalanchego_node_image_name} "
39
+ if [[ -n " ${image_prefix } " ]]; then
40
+ base_image_name=" ${image_prefix } /${base_image_name} "
41
+ avalanchego_node_image_name=" ${image_prefix } /${avalanchego_node_image_name} "
41
42
fi
42
43
local node_image_name=" ${base_image_name} -node:${TAG} "
43
44
local workload_image_name=" ${base_image_name} -workload:${TAG} "
@@ -63,6 +64,10 @@ function build_images {
63
64
64
65
# Build node image first to allow the workload image to use it.
65
66
${docker_cmd} -t " ${node_image_name} " -f " ${node_dockerfile} " " ${AVALANCHE_PATH} "
67
+ if [[ -n " ${image_prefix} " ]]; then
68
+ # Push images with an image prefix since the prefix defines a registry location
69
+ docker_cmd=" ${docker_cmd} --push"
70
+ fi
66
71
67
72
if [[ -n " ${node_only} " ]]; then
68
73
# Skip building the config and workload images. Supports building the avalanchego
@@ -99,13 +104,14 @@ function build_images {
99
104
100
105
TEST_SETUP=" ${TEST_SETUP:- } "
101
106
if [[ " ${TEST_SETUP} " == " avalanchego" ]]; then
102
- build_images avalanchego " ${AVALANCHE_PATH} /Dockerfile" " ${NODE_ONLY:- } "
107
+ build_images avalanchego " ${AVALANCHE_PATH} /Dockerfile" " ${IMAGE_PREFIX} " " ${ NODE_ONLY:- }"
103
108
elif [[ " ${TEST_SETUP} " == " xsvm" ]]; then
104
- # Only build the node image to use as the base for the xsvm image
109
+ # Only build the node image to use as the base for the xsvm image. Provide an empty
110
+ # image prefix (the 3rd argument) to prevent the image from being pushed
105
111
NODE_ONLY=1
106
- build_images avalanchego " ${AVALANCHE_PATH} /Dockerfile" " ${NODE_ONLY} "
112
+ build_images avalanchego " ${AVALANCHE_PATH} /Dockerfile" " " " ${NODE_ONLY} "
107
113
108
- build_images xsvm " ${AVALANCHE_PATH} /vms/example/xsvm/Dockerfile"
114
+ build_images xsvm " ${AVALANCHE_PATH} /vms/example/xsvm/Dockerfile" " ${IMAGE_PREFIX} "
109
115
else
110
116
echo " TEST_SETUP must be set. Valid values are 'avalanchego' or 'xsvm'"
111
117
exit 255
0 commit comments