Hello Team,
We are integrating Bitbucket with Jenkins and using the pipe.
Is there a way to pull the Job ID once the execution is completed so that i can construct the URL and put it in Bitbucket CI console output.
pipe: atlassian/jenkins-job-trigger:0.1.2
variables:
JENKINS_URL: $JENKINS_URL
JENKINS_USER: '$JENKINS_USERNAME'
JENKINS_TOKEN: $JENKINS_USER_TOKEN
JOB_NAME: 'job/$MY_JOB_NAME/job/main'
WAIT: 'true'
WAIT_MAX_TIME: 500
Debug: 'true'
Here once everything runs i am getting the Job {jobID} is triggered. But i need to get this JOB ID in a separate variable so that i can construct the URL and echo that in BB CI
@Sarath Nagarajan hi. First of all, please use the latest version of the pipe.
We have no clarification of Job ID in our pipe. We use build number of the job, is this what you need to construct your url?
Answering to your question, you could create your custom pipe based on jenkins-job-trigger, where you could fetch this url into some file as artifact, and after this parse artifact for your needed data.
Will this cover your case?
Guide of how to create your custom pipe
Regards, Igor
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.