Skip to content

Commit da11392

Browse files
committed
Reverting back to usage of tag instead of looping over local_tags
Signed-off-by: bharathappali <[email protected]>
1 parent 8208290 commit da11392

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

build_latest.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,17 +215,13 @@ function build_image() {
215215
repo=$1; shift;
216216
build=$1; shift;
217217
btype=$1; shift;
218+
local local_tag=$1; shift;
218219

219-
local local_tags=("$@") # copy arguments to local array
220-
for i in "${!local_tags[@]}"
221-
do
222-
echo "Tag - ${i} : ${local_tags[$i]}" # Adding an echo to check if jenkins build job is passing multiple tags
223-
tags="${tags} -t ${repo}:${local_tags[$i]}"
224-
done
220+
tags="${tags} -t ${repo}:${local_tag}"
225221

226222
auto_space_line=" "
227-
image_name="${repo}:${tag}"
228-
printf -v expanded_tags "%s ${repo}:%s " "-t" "${local_tags[@]}" # concatenate to single string : -t repo:tag -t repo:tag2
223+
image_name="${repo}:${local_tag}"
224+
printf -v expanded_tags "%s ${repo}:%s " "-t" "${local_tag}" # concatenate to single string : -t repo:tag -t repo:tag2
229225
expanded_tags=${expanded_tags%?} # remove trailing space
230226
dockerfile="Dockerfile.${vm}.${build}.${btype}"
231227
# Check if we need to build this image.
@@ -235,7 +231,7 @@ function build_image() {
235231
return;
236232
fi
237233

238-
echo "docker push ${repo}:${tag}" >> "${push_cmdfile}"
234+
echo "docker push ${repo}:${local_tag}" >> "${push_cmdfile}"
239235
echo "#####################################################"
240236
echo "INFO: docker build --no-cache ${expanded_tags} -f ${dockerfile} ."
241237
echo "#####################################################"

0 commit comments

Comments
 (0)