From d637dc8ee29ccc35030a22dd47d2512596113a7f Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jan 24 2018 16:25:14 +0000 Subject: Add a .cico.pipeline file to running tests in ci.centos.org Signed-off-by: Pierre-Yves Chibon --- diff --git a/.cico.pipeline b/.cico.pipeline new file mode 100644 index 0000000..366146f --- /dev/null +++ b/.cico.pipeline @@ -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('pagure') { + + 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'){ + // Install EPEL + onmyduffynode 'yum -y install epel-release' + } + + stage('Clone Test Suite') { + onmyduffynode "git clone -b \"${env.BRANCH_NAME}\" --single-branch --depth 1 https://pagure.io/pagure.git" + } + + stage('Run Test Suite') { + timeout(6, 'HOURS') { + onmyduffynode 'cd pagure && sh ./run_ci_tests.sh' + } + } + + } catch (e) { + currentBuild.result = "FAILED" + throw e + } finally { + stage('Deallocate Node'){ + sh 'cico node done ${SSID}' + } + } +}