Prevent tests Dockerfile to use cache of osm-packages repo
[osm/devops.git] / jenkins / ci-pipelines / ci_stage_3.groovy
index e93c9a9..cd7cc8e 100644 (file)
@@ -322,7 +322,8 @@ node("${params.NODE}") {
                                 usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
                     sh "docker login ${INTERNAL_DOCKER_REGISTRY} -u ${USERNAME} -p ${PASSWORD}"
                 }
-                moduleBuildArgs = ""
+                datetime = sh(returnStdout: true, script: "date +%Y-%m-%d:%H:%M:%S").trim()
+                moduleBuildArgs = " --build-arg CACHE_DATE=${datetime}"
                 for (packageName in builtModules.keySet()) {
                     envName=packageName.replaceAll("-","_").toUpperCase()+"_URL"
                     moduleBuildArgs += " --build-arg ${envName}=" + builtModules[packageName]
@@ -444,8 +445,17 @@ node("${params.NODE}") {
                     remote.logLevel = 'INFO'
                     remote.pty = true
 
+                    // Force time sync to avoid clock drift and invalid certificates
                     sshCommand remote: remote, command: """
-                        wget https://osm-download.etsi.org/ftp/osm-10.0-ten/install_osm.sh
+                        sudo apt update
+                        sudo apt install -y ntp
+                        sudo service ntp stop
+                        sudo ntpd -gq
+                        sudo service ntp start
+                    """
+
+                    sshCommand remote: remote, command: """
+                        wget https://osm-download.etsi.org/ftp/osm-11.0-eleven/install_osm.sh
                         chmod +x ./install_osm.sh
                         sed -i '1 i\\export PATH=/snap/bin:\${PATH}' ~/.bashrc
                     """