From de83cd6ce36a5ac394519e648fc7f7ad1a9d536f Mon Sep 17 00:00:00 2001 From: Michal Konečný Date: Aug 16 2022 12:09:18 +0000 Subject: Use Duffy instead of cico in Pagure CI The CentOS CI is migrating to new Duffy client for machine provisioning. Let's switch your .cico.pipeline to use it. Signed-off-by: Michal Konečný --- diff --git a/.cico.pipeline b/.cico.pipeline index cfadb78..15d1bf5 100644 --- a/.cico.pipeline +++ b/.cico.pipeline @@ -16,13 +16,13 @@ def notifyPagurePR(repo, msg, status, phase, credentials = 'pagure-auth'){ def onmyduffynode(script){ ansiColor('xterm'){ timestamps{ - sh 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root ${DUFFY_NODE}.ci.centos.org -t \"export REPO=${REPO}; export BRANCH=${BRANCH};\" "' + script + '"' + sh 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root ${DUFFY_NODE} -t \"export REPO=${REPO}; export BRANCH=${BRANCH};\" "' + 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:~/ ./" + sh 'rsync -e "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root " -Ha --include=' + rsyncpath + " ${DUFFY_NODE}:~/ ./" } node('cico-workspace') { @@ -36,11 +36,12 @@ node('cico-workspace') { stage('Allocate Node'){ duffy_rtn=sh( - script: 'cico --debug node get --release 8-stream -f value -c hostname -c comment', + script: 'duffy client request-session pool=virt-ec2-t2-centos-9s-x86_64,quantity=1', returnStdout: true ).trim().tokenize(' ') - env.DUFFY_NODE=duffy_rtn[0] - env.SSID=duffy_rtn[1] + def jsonObj = readJSON text: duffy_rtn + env.DUFFY_NODE=jsonObj[`nodes`][`hostname'] + env.SSID=jsonObj['session']['id'] env.BRANCH=params.BRANCH env.REPO=params.REPO } @@ -71,7 +72,7 @@ node('cico-workspace') { } finally { stage('Deallocate Node'){ - sh 'cico node done ${SSID}' + sh 'duffy client retire-session ${SSID}' } stage('Notify PR'){