#5310 Add correct label to .cico.pipeline
Merged 2 years ago by pingou. Opened 2 years ago by zlopez.
zlopez/pagure ci  into  master

file modified
+47 -43
@@ -25,60 +25,64 @@ 

      sh 'rsync -e "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root " -Ha --include=' +  rsyncpath +  " ${DUFFY_NODE}.ci.centos.org:~/ ./"

  }

  

- node('pagure') {

+ agent {

+     node('pagure') {

  

-     properties([

-             parameters([

-                 string(defaultValue: "", description: "", name: "REPO"),

-                 string(defaultValue: "", description: "", name: "BRANCH"),

+         label 'cico-workspace'

+ 

+         properties([

+                 parameters([

+                     string(defaultValue: "", description: "", name: "REPO"),

+                     string(defaultValue: "", description: "", name: "BRANCH"),

+                     ])

                  ])

-             ])

- 

-     stage('Allocate Node'){

-         env.CICO_API_KEY = env.DUFFY_KEY

-         duffy_rtn=sh(

-             script: 'cico --debug node get -f value -c hostname -c comment',

-             returnStdout: true

-             ).trim().tokenize(' ')

-         env.DUFFY_NODE=duffy_rtn[0]

-         env.SSID=duffy_rtn[1]

-         env.BRANCH=params.BRANCH

-         env.REPO=params.REPO

-     }

  

-     try {

-         stage('Pre Setup Node'){

-             // Install EPEL

-             onmyduffynode 'yum -y install epel-release git'

+         stage('Allocate Node'){

+             env.CICO_API_KEY = env.DUFFY_KEY

+             duffy_rtn=sh(

+                 script: 'cico --debug node get -f value -c hostname -c comment',

+                 returnStdout: true

+                 ).trim().tokenize(' ')

+             env.DUFFY_NODE=duffy_rtn[0]

+             env.SSID=duffy_rtn[1]

+             env.BRANCH=params.BRANCH

+             env.REPO=params.REPO

          }

  

-         stage('Notify PR'){

-             notifyPagurePR("pagure", "Tests running ", "BUILDING", "STARTED")

-         }

+         try {

+             stage('Pre Setup Node'){

+                 // Install EPEL

+                 onmyduffynode 'yum -y install epel-release git'

+             }

  

-         stage('Clone Test Suite') {

-             onmyduffynode "GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone --single-branch --depth 1 https://pagure.io/pagure.git"

-         }

+             stage('Notify PR'){

+                 notifyPagurePR("pagure", "Tests running ", "BUILDING", "STARTED")

+             }

  

-         stage('Run Test Suite') {

-             timeout(time: 6, unit: 'HOURS') {

-                 onmyduffynode 'cd pagure && sh ./run_ci_tests_containers.sh'

+             stage('Clone Test Suite') {

+                 onmyduffynode "GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone --single-branch --depth 1 https://pagure.io/pagure.git"

              }

-         }

  

-     } catch (e) {

-         currentBuild.result = "FAILURE"

-         throw e

-     } finally {

+             stage('Run Test Suite') {

+                 timeout(time: 6, unit: 'HOURS') {

+                     onmyduffynode 'cd pagure && sh ./run_ci_tests_containers.sh'

+                 }

+             }

  

-         stage('Deallocate Node'){

-             sh 'cico node done ${SSID}'

-         }

+         } catch (e) {

+             currentBuild.result = "FAILURE"

+             throw e

+         } finally {

  

-         stage('Notify PR'){

-             res = currentBuild.currentResult

-             notifyPagurePR("pagure", "Build " + res + "! ", res, "FINALIZED")

-         }

+             stage('Deallocate Node'){

+                 sh 'cico node done ${SSID}'

+             }

  

+             stage('Notify PR'){

+                 res = currentBuild.currentResult

+                 notifyPagurePR("pagure", "Build " + res + "! ", res, "FINALIZED")

+             }

+ 

+         }

      }

  }

The new openshift jenkins instance need to have label specified to execute on
correct node.

Signed-off-by: Michal Konečný mkonecny@redhat.com

Pull-Request has been merged by pingou

2 years ago
Metadata