@@ -22,7 +22,6 @@ release_tags=${RELEASE_TAGS:-"${commit}"}
2222
2323supported_arches=${ARCHES:- " linux/amd64" }
2424
25- arch_file_prefix=" ${script_dir} /../tags-architectures-"
2625arch_prefix=" linux/"
2726
2827# Get a list of comma-separated tags (e.g. latest,5d0da3dc9764-dev), return
@@ -36,8 +35,8 @@ function get_tag_string() {
3635
3736 # if we are building fora single arch, then also append this to the tag
3837 if [[ -n " ${arch:- } " ]] && [[ " ${arch:- } " != * ,* ]]; then
39- # strip the `linux/` from the docker buildx platform format
40- arch_suffix=" -${arch# " linux/ " } "
38+ # strip the `linux/` from the docker buildx platform format in the tag
39+ arch_suffix=" -${arch# ${arch_prefix} } "
4140 fi
4241
4342 for tag in ${tags/ ,/ } ; do
@@ -72,54 +71,9 @@ function build_caa_payload_image() {
7271 popd
7372}
7473
75- function get_arch_specific_tag_string() {
76- local tags=" $1 "
77- local arch=" $2 "
78- local tag_string=" "
79-
80- for tag in ${tags/ ,/ } ; do
81- tag_string+=" -t ${registry} /${name} :${tag} -${arch} "
82- done
83-
84- echo " $tag_string "
85- }
86-
87- # accept one arch as --platform
88- function build_caa_payload_arch_specific() {
89- pushd " ${script_dir} /../../"
90-
91- arch=${supported_arches# " $arch_prefix " }
92-
93- echo " arch=" $arch >> " $arch_file_prefix$arch "
94-
95- local tag_string
96- local build_type=dev
97-
98- tag_string=" $( get_arch_specific_tag_string " $dev_tags " " ${arch} " ) "
99- if [[ " $release_build " == " true" ]]; then
100- tag_string=" $( get_arch_specific_tag_string " $release_tags " " ${arch} " ) "
101- build_type=release
102- fi
103-
104- docker buildx build --platform " ${supported_arches} " \
105- --build-arg RELEASE_BUILD=" ${release_build} " \
106- --build-arg BUILD_TYPE=" ${build_type} " \
107- --build-arg VERSION=" ${version} " \
108- --build-arg COMMIT=" ${commit} " \
109- --build-arg YQ_VERSION=" ${YQ_VERSION} " \
110- -f cloud-api-adaptor/Dockerfile \
111- ${tag_string} \
112- --push \
113- .
114- popd
115- }
116-
11774# Get the options
118- while getopts " :ai " option; do
75+ while getopts " :i " option; do
11976 case $option in
120- a) # image arch specific
121- build_caa_payload_arch_specific
122- exit ;;
12377 i) # image
12478 build_caa_payload_image
12579 exit ;;
0 commit comments