File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff 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 " #####################################################"
You can’t perform that action at this time.
0 commit comments