NSM: Update Jenkinsfile for meridio 49/15049/1
authorrobert.tomczyk <robert.tomczyk.est@gmail.com>
Thu, 8 Sep 2022 17:26:30 +0000 (18:26 +0100)
committerrobert.tomczyk <robert.tomczyk.est@gmail.com>
Thu, 8 Sep 2022 17:26:30 +0000 (18:26 +0100)
- Specify correct build server: nordix-nsm-build-ubuntu1804
- Source profile with correct PATH for go binary

Change-Id: I0ffc80cf49492865e592d710875761a6c9d08586

jjb/nsm/Jenkinsfile

index 722467629a2fc95200848bd7c5575282b1d2463d..4362fc663ea2302429a1b893a3d78499e478d166 100644 (file)
@@ -24,7 +24,7 @@ in_progress = 'In Progress.'
 completed = 'Completed.'
 failed = 'Failed'
 
-node {
+node ('nordix-nsm-build-ubuntu1804') {
     build_number = env.BUILD_NUMBER
     workspace = env.WORKSPACE
     ws("${workspace}/${build_number}") {
@@ -97,7 +97,10 @@ def UnitTests() {
         stage('Unit Tests') {
             try {
                 SetBuildStatus(in_progress, context, pending)
-                sh 'make test'
+                sh '''
+                    . \${HOME}/.profile
+                    make test
+                '''
                 SetBuildStatus(completed, context, success)
             } catch (Exception e) {
                 SetBuildStatus(failed, context, failure)
@@ -114,7 +117,10 @@ def Linter() {
         stage('Linter') {
             try {
                 SetBuildStatus(in_progress, context, pending)
-                sh 'make lint'
+                sh '''
+                    . \${HOME}/.profile
+                   make lint
+                '''
                 SetBuildStatus(completed, context, success)
             } catch (Exception e) {
                 SetBuildStatus(failed, context, failure)
@@ -136,7 +142,10 @@ def GeneratedCode() {
         SetBuildStatus(in_progress, context, pending)
         stage('go mod tidy') {
             try {
-                sh 'go mod tidy'
+                sh '''
+                    . \${HOME}/.profile
+                    go mod tidy
+                '''
                 if (GetModifiedFiles() != '') {
                     throw new Exception(exception_message)
                 }
@@ -149,7 +158,10 @@ def GeneratedCode() {
         }
         stage('go generate ./...') {
             try {
-                sh 'make generate'
+                sh '''
+                    . \${HOME}/.profile
+                    make generate
+                '''
                 if (GetModifiedFiles() != '') {
                     throw new Exception(exception_message)
                 }