From 95cab9148827ccac6cdf828dd1f2e7d6a12115e2 Mon Sep 17 00:00:00 2001 From: Brian Stinson Date: Apr 12 2018 18:48:17 +0000 Subject: [PATCH 1/2] add a step to flag the PR from the jenkins job --- diff --git a/.cico.pipeline b/.cico.pipeline index ab00202..dfb4318 100644 --- a/.cico.pipeline +++ b/.cico.pipeline @@ -1,3 +1,14 @@ +import groovy.json.JsonOutput + +def notifyPagurePR(repo, msg, status, credentials = 'pagure-push-secret'){ + def json = JsonOutput.toJson([name: 'pagure', url: env.JOB_NAME, build: [full_url: currentBuild.absoluteUrl, status: status, number: currentBuild.number]]) + println json + + withCredentials([string(credentialsId: credentials, variable: PAGURE_PUSH_SECRET)]) { + sh "curl -X POST -d \'$json\' https://pagure.io/api/0/ci/jenkins/$repo/${env.PAGURE_PUSH_SECRET}/build-finished" + } +} + def onmyduffynode(script){ ansiColor('xterm'){ timestamps{ @@ -48,7 +59,7 @@ node('pagure') { } } catch (e) { - currentBuild.result = "FAILED" + currentBuild.result = "FAILURE" throw e } finally { stage('Sync Artifacts'){ @@ -59,6 +70,11 @@ node('pagure') { sh 'cico node done ${SSID}' } + stage('Notify PR'){ + res = currentBuild.currentResult + notifyPagurePR("pagure", "Build " + res + "! ", res, currentBuild.absoluteUrl) + } + stage('Archive Artifacts'){ archiveArtifacts artifacts: 'pagure/*.out' } From a028a64645b8791dfcb9e8f996ed8790e8dcd606 Mon Sep 17 00:00:00 2001 From: Brian Stinson Date: Apr 12 2018 18:48:17 +0000 Subject: [PATCH 2/2] we already have the credential --- diff --git a/.cico.pipeline b/.cico.pipeline index dfb4318..bb996ea 100644 --- a/.cico.pipeline +++ b/.cico.pipeline @@ -1,6 +1,6 @@ import groovy.json.JsonOutput -def notifyPagurePR(repo, msg, status, credentials = 'pagure-push-secret'){ +def notifyPagurePR(repo, msg, status, credentials = 'pagure-auth'){ def json = JsonOutput.toJson([name: 'pagure', url: env.JOB_NAME, build: [full_url: currentBuild.absoluteUrl, status: status, number: currentBuild.number]]) println json