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('factory2'){ 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 and the SCLs repo onmyduffynode 'yum -y install epel-release yum-config-manager centos-release-scl && yum-config-manager --enable rhel-server-rhscl-7-rpms' onmyduffynode 'yum -y install python27 python-devel rh-python36 @development krb5-devel openssl-devel libffi-devel swig createrepo_c cairo-gobject-devel gobject-introspection-devel' // Remove this once it's available in the official repos onmyduffynode 'yum -y install https://kojipkgs.fedoraproject.org//packages/libmodulemd/1.0.4/1.fc26/x86_64/libmodulemd-1.0.4-1.fc26.x86_64.rpm' // Update pip and setuptools and install tox in the SCL environment onmyduffynode 'scl enable python27 \'pip install --upgrade pip setuptools tox\'' onmyduffynode 'scl enable rh-python36 \'pip install --upgrade pip setuptools tox\'' } stage('Clone Test Suite') { onmyduffynode "git clone -b \"${env.BRANCH_NAME}\" --single-branch --depth 1 https://pagure.io/fm-orchestrator" } stage('Run Test Suite') { timeout(20) { // Run tox in the SCL environment onmyduffynode 'cd fm-orchestrator && scl enable rh-python36 \'tox -r\'' } } }catch (e){ currentBuild.result = "FAILED" throw e } finally { stage('Deallocate Node'){ sh 'cico node done ${SSID}' } } }