@@ -33,6 +33,7 @@ usage: $0 [CMD] [OPTIONS]
3333  -password=PASSWORD            Password to loging at the docker registry. 
3434  -ci                           Install CI tools in image 
3535  -dry-run                      Do not push images to the repository 
36+   -push-latest                  Push the latest image to the repository 
3637  -no-constant-build-dir        Do not use constant build directory 
3738  -h -help                      Show this message and exits 
3839
@@ -136,10 +137,22 @@ _push() {
136137        orfsTag=${org} /orfs:${tag} 
137138        echo  " Renaming docker image: ${builderTag}  -> ${orfsTag} " 
138139        ${DOCKER_CMD}  tag ${builderTag}  ${orfsTag} 
140+ 
139141        if  [[ " ${dryRun} "   ==  1 ]];  then 
140142            echo  " [DRY-RUN] ${DOCKER_CMD}  push ${orfsTag} " 
143+             if  [[ " ${pushLatest} "   ==  1 ]];  then 
144+                 echo  " [DRY-RUN] ${DOCKER_CMD}  tag ${orfsTag}  \" ${org} /orfs:latest\" " 
145+                 echo  " [DRY-RUN] ${DOCKER_CMD}  push \" ${org} /orfs:latest\" " 
146+             fi 
141147        else 
142148            ${DOCKER_CMD}  push ${orfsTag} 
149+ 
150+             #  Only tag and push as latest if requested
151+             if  [[ " ${pushLatest} "   ==  1 ]];  then 
152+                 ${DOCKER_CMD}  tag ${orfsTag}  " ${org} /orfs:latest" 
153+                 ${DOCKER_CMD}  push " ${org} /orfs:latest" 
154+                 echo  " Tagged and pushed ${org} /orfs:latest" 
155+             fi 
143156        fi 
144157    fi 
145158}
@@ -174,6 +187,7 @@ numThreads="-1"
174187tag=" " 
175188options=" " 
176189dryRun=0
190+ pushLatest=0
177191
178192while  [ " $# "   -gt  0 ];  do 
179193    case  " ${1} "   in 
@@ -186,6 +200,9 @@ while [ "$#" -gt 0 ]; do
186200        -dry-run )
187201            dryRun=1
188202            ;;
203+         -push-latest )
204+             pushLatest=1
205+             ;;
189206        -os=*  )
190207            os=" ${1#* =} " 
191208            ;;
0 commit comments