X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=jenkins%2Fci-pipelines%2Fci_stage_3.groovy;h=006509294f2e4e8e78c0c92bc1c40c9ed72771c6;hb=df75b7aed0e184455b9de743f82003a1a2513956;hp=4fea5919ab4fd61a95865425e7154a29aed2b6be;hpb=60fbb95e099692f52594cf7af053b276a4731700;p=osm%2Fdevops.git diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index 4fea5919..00650929 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -104,7 +104,8 @@ void run_robot_systest(String tagName, -v ${portmappingfile}:/root/port-mapping.yaml ${hostfilemount} opensourcemano/tests:${tagName} \ -c -t ${testName}""") } finally { - sh("cp ${tempdir}/* .") + sh("cp ${tempdir}/*.xml .") + sh("cp ${tempdir}/*.html .") outputDirectory = sh(returnStdout: true, script: 'pwd').trim() println("Present Directory is : ${outputDirectory}") step([ @@ -153,8 +154,7 @@ void archive_logs(Map remote) { sshCommand remote: remote, command: '''ls -al logs''' sshGet remote: remote, from: 'logs', into: '.', override: true sh 'cp logs/* .' - sshGet remote: remote, from: 'ens3.pcap', into: 'ens3.pcap', override: true - archiveArtifacts artifacts: '*.log, *.pcap' + archiveArtifacts artifacts: '*.log' } String get_value(String key, String output) { @@ -216,7 +216,9 @@ node("${params.NODE}") { /////////////////////////////////////////////////////////////////////////////////////// stage('Copy Artifacts') { // cleanup any previous repo - sh 'rm -rf repo' + sh "tree -fD repo || exit 0" + sh 'rm -rvf repo' + sh "tree -fD repo && lsof repo || exit 0" dir('repo') { packageList = [] dir("${RELEASE}") { @@ -256,7 +258,7 @@ node("${params.NODE}") { parallelSteps = [:] list = ['RO', 'osmclient', 'IM', 'devops', 'MON', 'N2VC', 'NBI', - 'common', 'LCM', 'POL', 'NG-UI', 'PLA', 'tests'] + 'common', 'LCM', 'POL', 'NG-UI', 'NG-SA', 'PLA', 'tests'] if (upstreamComponent.length() > 0) { println("Skipping upstream fetch of ${upstreamComponent}") list.remove(upstreamComponent) @@ -324,6 +326,8 @@ node("${params.NODE}") { ci_helper.check_status_http_server(NODE_IP_ADDRESS, repo_port) } + sh "tree -fD repo" + // Unpack devops package into temporary location so that we use it from upstream if it was part of a patch osm_devops_dpkg = sh(returnStdout: true, script: 'find ./repo/release/pool/ -name osm-devops*.deb').trim() devopstempdir = sh(returnStdout: true, script: 'mktemp -d').trim() @@ -449,8 +453,9 @@ node("${params.NODE}") { 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: 'nohup sudo tcpdump -i ens3 -w ens3.pcap -s 400 & sleep 5' sshCommand remote: remote, command: 'sudo apt-get update' sshCommand remote: remote, command: 'sudo apt-get install -y chrony' sshCommand remote: remote, command: 'sudo service chrony stop' @@ -496,7 +501,7 @@ node("${params.NODE}") { ] sshCommand remote: remote, command: ''' - wget https://osm-download.etsi.org/ftp/osm-11.0-eleven/install_osm.sh + wget https://osm-download.etsi.org/ftp/osm-13.0-thirteen/install_osm.sh chmod +x ./install_osm.sh sed -i '1 i\\export PATH=/snap/bin:\$PATH' ~/.bashrc ''' @@ -546,10 +551,6 @@ node("${params.NODE}") { prometheusPort = 9091 osmHostname = IP_ADDRESS } - sshCommand remote: remote, command: """ - sudo killall tcpdump - """ - } // stage("Install") /////////////////////////////////////////////////////////////////////////////////////// // Health check of installed OSM in remote vm @@ -572,7 +573,6 @@ node("${params.NODE}") { if ( params.DO_ROBOT ) { try { stage('System Integration Test') { - if (useCharmedInstaller) { tempdir = sh(returnStdout: true, script: 'mktemp -d').trim() sh(script: "touch ${tempdir}/hosts") @@ -637,7 +637,8 @@ EOF""" parallelSteps[module] = { dir("$module") { - sh("""docker tag opensourcemano/${moduleName}:${moduleTag} \ + sh("docker pull ${INTERNAL_DOCKER_REGISTRY}opensourcemano/${moduleName}:${moduleTag}") + sh("""docker tag ${INTERNAL_DOCKER_REGISTRY}opensourcemano/${moduleName}:${moduleTag} \ opensourcemano/${moduleName}:${dockerTag}""") sh "docker push opensourcemano/${moduleName}:${dockerTag}" } @@ -645,7 +646,6 @@ EOF""" } parallel parallelSteps } - stage('Snap promotion') { withCredentials([string(credentialsId: 'Snapstore', variable: 'SNAPCRAFT_STORE_CREDENTIALS')]) { snaps = ['osmclient'] @@ -660,12 +660,12 @@ EOF""" edge_rev = sh(returnStdout: true, script: "snapcraft revisions $snap | " + "grep \"$track\" | tail -1 | awk '{print \$1}'").trim() - print "edge rev is $edge_rev" track = channel + 'beta\\*' beta_rev = sh(returnStdout: true, script: "snapcraft revisions $snap | " + "grep \"$track\" | tail -1 | awk '{print \$1}'").trim() - print "beta rev is $beta_rev" + + print "Edge: $edge_rev, Beta: $beta_rev" if (edge_rev != beta_rev) { print "Promoting $edge_rev to beta in place of $beta_rev" @@ -682,18 +682,22 @@ EOF""" } finally { stage('Archive Container Logs') { if ( ARCHIVE_LOGS_FLAG ) { - // Archive logs - remote = [ - name: containerName, - host: IP_ADDRESS, - user: 'ubuntu', - identityFile: SSH_KEY, - allowAnyHosts: true, - logLevel: 'INFO', - pty: true - ] - println('Archiving container logs') - archive_logs(remote) + try { + // Archive logs + remote = [ + name: containerName, + host: IP_ADDRESS, + user: 'ubuntu', + identityFile: SSH_KEY, + allowAnyHosts: true, + logLevel: 'INFO', + pty: true + ] + println('Archiving container logs') + archive_logs(remote) + } catch (Exception e) { + println('Error fetching logs: '+ e.getMessage()) + } } // end if ( ARCHIVE_LOGS_FLAG ) } stage('Cleanup') {