ORAN: SMO-TEIV: Add nordix verify job (maven)
[infra/cicd.git] / jjb / nsm / e2e.Jenkinsfile
index 06e0e12686a6e3834876ec55f9043d7d1a94e4e2..26b64b39f40cd7463130f4bfb0b570ceba927682 100644 (file)
@@ -33,6 +33,7 @@ node('nordix-nsm-build-ubuntu2204') {
         def environment_name = params.ENVIRONMENT_NAME
         def focus = params.FOCUS
         def skip = params.SKIP
+        def kind_external_host_default_route = params.KIND_EXTERNAL_HOST_DEFAULT_ROUTE
 
         def seed = params.SEED
 
@@ -53,7 +54,7 @@ node('nordix-nsm-build-ubuntu2204') {
             stage('Environment') {
                 currentBuild.description = "Meridio version: $meridio_version / TAPA version: $tapa_version / NSM version: $nsm_version / IP Family: $ip_family / Kubernetes version: $kubernetes_version / Current Branch: $current_branch / Seed: $seed"
 
-                def command = "make -s -C test/e2e/environment/$environment_name/ KUBERNETES_VERSION=$kubernetes_version NSM_VERSION=$nsm_version IP_FAMILY=$ip_family KUBERNETES_WORKERS=$number_of_workers MERIDIO_VERSION=$meridio_version TAPA_VERSION=$tapa_version"
+                def command = "make -s -C test/e2e/environment/$environment_name/ KUBERNETES_VERSION=$kubernetes_version NSM_VERSION=$nsm_version IP_FAMILY=$ip_family KUBERNETES_WORKERS=$number_of_workers MERIDIO_VERSION=$meridio_version TAPA_VERSION=$tapa_version KIND_EXTERNAL_HOST_DEFAULT_ROUTE=$kind_external_host_default_route"
                 try {
                     ExecSh(command).call()
                 } catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) {
@@ -82,7 +83,7 @@ node('nordix-nsm-build-ubuntu2204') {
         }
         stage('Report') {
             try {
-                Report().call()
+                Report(build_number).call()
             } catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) {
                 currentBuild.result = 'ABORTED'
             } catch (Exception e) {
@@ -169,7 +170,7 @@ def GetSeed() {
 }
 
 // http://JENKINS_URL/job/meridio-e2e-test-kind/api/json?tree=allBuilds[status,timestamp,id,result,description]{0,9}&pretty=true
-def Report() {
+def Report(id) {
     return {
         def jenkins_url = 'jenkins.nordix.org'
 
@@ -199,8 +200,15 @@ def Report() {
         ReportIPFamily(success, failure).call()
         ReportKubernetes(success, failure).call()
 
+        sh 'printenv > _output/parameters.txt'
+        sh "echo 'RESULT=$currentBuild.result' >> _output/parameters.txt"
+
         try {
             archiveArtifacts artifacts: '_output/**/*.*', followSymlinks: false
+            sh "tar -czvf ${id}.tar.gz -C _output ."
+            withCredentials([string(credentialsId: 'nsm-nordix-artifactory-api-key', variable: 'API_KEY')]) {
+                sh "curl -H 'X-JFrog-Art-Api:${API_KEY}' -T ${id}.tar.gz 'https://artifactory.nordix.org/artifactory/cloud-native/meridio/e2e-test-reports/${id}.tar.gz'"
+            }
         } catch (Exception e) {
         }
     }