From 4762ba5c3f877328470dc50b919f6195f1b2df9e Mon Sep 17 00:00:00 2001 From: Mikhail Goncharov Date: Thu, 12 Dec 2019 09:40:31 +0100 Subject: [PATCH] Resolve phabricator diff id and add link in description --- Jenkins/Phabricator-pipeline/Jenkinsfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Jenkins/Phabricator-pipeline/Jenkinsfile b/Jenkins/Phabricator-pipeline/Jenkinsfile index 6bb71ae..3e170ba 100644 --- a/Jenkins/Phabricator-pipeline/Jenkinsfile +++ b/Jenkins/Phabricator-pipeline/Jenkinsfile @@ -33,7 +33,16 @@ pipeline { steps { echo "Building diff ${DIFF_ID} with PHID ${PHID}" script { - currentBuild.displayName = "diff ${DIFF_ID}" + def revision_phid = sh(script: + 'echo \'{"constraints":{"ids":[' + DIFF_ID + ']}}\' | '+ + 'arc call-conduit --conduit-uri=$PHABRICATOR_HOST --conduit-token $CONDUIT_TOKEN differential.diff.search | ' + + 'jq -r ".response.data[0].fields.revisionPHID"', returnStdout: true).trim() + def drev_id = sh(script: + 'echo \'{"constraints":{"phids":["' + revision_phid + '"]}}\' | ' + + 'arc call-conduit --conduit-uri=$PHABRICATOR_HOST --conduit-token $CONDUIT_TOKEN differential.revision.search | ' + + 'jq -r ".response.data[0].id"', returnStdout: true).trim() + currentBuild.displayName += " D${drev_id}" + currentBuild.description = "D${drev_id}" } } }