#296 add a cico template
Merged 3 years ago by puiterwijk. Opened 3 years ago by bstinson.
bstinson/ipsilon add-cico  into  master

file added
+49
@@ -0,0 +1,49 @@ 

+ def onmyduffynode(script){

+     ansiColor('xterm'){

+         timestamps{

+             sh 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root ${DUFFY_NODE}.ci.centos.org -t "' + script + '"'

+         }

+     }

+ }

+ 

+ def syncfromduffynode(rsyncpath){

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

+ }

+ 

+ node('ipsilon'){

+ 

+     stage('Allocate Node'){

+         env.CICO_API_KEY = readFile("${env.HOME}/duffy.key").trim()

+         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]

+     }

+ 

+     try{

+         stage('Pre Setup Node'){

+             onmyduffynode 'yum -y install @development docker'

+             onmyduffynode 'systemctl start docker'

+         }

+ 

+         stage('Clone Test Suite') {

+             onmyduffynode "git clone -b \"${env.BRANCH_NAME}\" https://pagure.io/ipsilon"

+         }

+ 

+         stage('Run Test Suite') {

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

+                 onmyduffynode 'cd ipsilon && make -j8 containertest'

+             }

+         }

+ 

+     }catch (e){

+         currentBuild.result = "FAILED"

+         throw e 

+     } finally {

+         stage('Deallocate Node'){

+             sh 'cico node done ${SSID}'

+         }

+     }

+ }

Commit 85dfc94 fixes this pull-request

Pull-Request has been merged by puiterwijk

3 years ago
Metadata