Minor fix in stage3 during push to dockerhub
[osm/devops.git] / jenkins / ci-pipelines / ci_stage_3.groovy
index eb5bd13..c428e08 100644 (file)
@@ -456,6 +456,9 @@ node("${params.NODE}") {
                     remote.logLevel = 'INFO'
                     remote.pty = true
 
+                    // Ensure the VM is ready
+                    sshCommand remote: remote, command: 'cloud-init status --wait'
+
                     // Force time sync to avoid clock drift and invalid certificates
                     sshCommand remote: remote, command: """
                         sudo apt update
@@ -603,7 +606,9 @@ EOF"""
 
                                 parallelSteps[module] = {
                                     dir("$module") {
-                                        sh "docker tag opensourcemano/${moduleName}:${moduleTag} opensourcemano/${moduleName}:${dockerTag}"
+                                        sh("docker pull ${INTERNAL_DOCKER_REGISTRY}opensourcemano/${moduleName}:${moduleTag}")
+                                        sh("""docker tag opensourcemano/${moduleName}:${moduleTag} \
+                                           opensourcemano/${moduleName}:${dockerTag}""")
                                         sh "docker push opensourcemano/${moduleName}:${dockerTag}"
                                     }
                                 }