build-name-setter plugin: how to get a new build name value

76 views
Skip to first unread message

Alex Domoradov

unread,
Apr 19, 2016, 8:08:23 AM4/19/16
to Jenkins Users
Hello,

I'm using build-name-setter plugin with the following settings for Build name macro template

v${BUILD_LOG_REGEX, regex="(.*)Current build number: ([0-9]\.[0-9]\.[0-9]+)(.*)", maxMatches=1, showTruncatedLines=false, substText="$2", addNewline=false}.b${BUILD_NUMBER}_${GIT_REVISION, length=8}

12:54:17 Evaluated macro: 'v1.2.06.b14_4fd204ef'
12:54:17 Setting build name to 'v1.2.06.b14_4fd204ef'

All works fine and my job name is set to v1.2.06.b14_4fd204ef. But I need to get access to this value in a shell script (maybe via variable). Is it possible? if it's not - maybe some workaround?

I have tried

echo "BUILD_NUMBER - ${BUILD_NUMBER}"
echo "BUILD_ID - ${BUILD_ID}"
echo "BUILD_DISPLAY_NAME - ${BUILD_DISPLAY_NAME}"
echo "JOB_NAME - ${JOB_NAME}"
echo "BUILD_TAG - ${BUILD_TAG}"

but non of them fit my requirements
Reply all
Reply to author
Forward
0 new messages