I am calling pipe in my script section to call a jenkins job from BB yml. The stage (in BB) is getting success however, no job got triggered in Jenkins
--env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \--env=BITBUCKET_PROJECT_UUID="$BITBUCKET_PROJECT_UUID" \--env=BITBUCKET_REPO_IS_PRIVATE="$BITBUCKET_REPO_IS_PRIVATE" \--env=BITBUCKET_WORKSPACE="$BITBUCKET_WORKSPACE" \--env=BITBUCKET_REPO_OWNER_UUID="$BITBUCKET_REPO_OWNER_UUID" \--env=BITBUCKET_BRANCH="$BITBUCKET_BRANCH" \--env=BITBUCKET_REPO_UUID="$BITBUCKET_REPO_UUID" \--env=BITBUCKET_PROJECT_KEY="$BITBUCKET_PROJECT_KEY" \--env=BITBUCKET_REPO_SLUG="$BITBUCKET_REPO_SLUG" \--env=CI="$CI" \--env=BITBUCKET_REPO_OWNER="$BITBUCKET_REPO_OWNER" \--env=BITBUCKET_STEP_RUN_NUMBER="$BITBUCKET_STEP_RUN_NUMBER" \--env=BITBUCKET_BUILD_NUMBER="$BITBUCKET_BUILD_NUMBER" \--env=BITBUCKET_GIT_SSH_ORIGIN="$BITBUCKET_GIT_SSH_ORIGIN" \--env=BITBUCKET_PIPELINE_UUID="$BITBUCKET_PIPELINE_UUID" \--env=BITBUCKET_COMMIT="$BITBUCKET_COMMIT" \--env=BITBUCKET_CLONE_DIR="$BITBUCKET_CLONE_DIR" \--env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \--env=BITBUCKET_STEP_UUID="$BITBUCKET_STEP_UUID" \--env=BITBUCKET_DOCKER_HOST_INTERNAL="$BITBUCKET_DOCKER_HOST_INTERNAL" \--env=DOCKER_HOST="tcp://host.docker.internal:2375" \--env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \--env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/jenkins-job-trigger" \--env=JENKINS_TOKEN="secureToken" \--env=JENKINS_URL="https://jenkins.p.morconnect.com/online/job" \--env=JENKINS_USER="sarathnagarajan" \--env=JOB_NAME="online-mymorrisons-automation/sonar-reporting" \--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \bitbucketpipelines/jenkins-job-trigger:0.1.1Unable to find image 'bitbucketpipelines/jenkins-job-trigger:0.1.1' locally0.1.1: Pulling from bitbucketpipelines/jenkins-job-triggerb4d181a07f80: Pulling fs layera1111a8f2ec3: Pulling fs layered53099fbce6: Pulling fs layerdc539afda2c1: Pulling fs layer77bc0d833cb6: Pulling fs layerea1ffd508d33: Pulling fs layere201113b9485: Pulling fs layer00bf2b3661fe: Pulling fs layerd7f9ccdbfde4: Pulling fs layerdc539afda2c1: Waiting77bc0d833cb6: Waitingea1ffd508d33: Waitinge201113b9485: Waiting00bf2b3661fe: Waitingd7f9ccdbfde4: Waitinga1111a8f2ec3: Verifying Checksuma1111a8f2ec3: Download completeed53099fbce6: Verifying Checksumed53099fbce6: Download completeb4d181a07f80: Verifying Checksumb4d181a07f80: Download completeea1ffd508d33: Verifying Checksumea1ffd508d33: Download completedc539afda2c1: Verifying Checksumdc539afda2c1: Download complete77bc0d833cb6: Verifying Checksum77bc0d833cb6: Download complete00bf2b3661fe: Verifying Checksum00bf2b3661fe: Download completee201113b9485: Verifying Checksume201113b9485: Download completed7f9ccdbfde4: Verifying Checksumd7f9ccdbfde4: Download completeb4d181a07f80: Pull completea1111a8f2ec3: Pull completeed53099fbce6: Pull completedc539afda2c1: Pull complete77bc0d833cb6: Pull completeea1ffd508d33: Pull completee201113b9485: Pull complete00bf2b3661fe: Pull completed7f9ccdbfde4: Pull completeDigest: sha256:2cebbe81f365578b04a955fb1be97083181863d1755f9fd0ca122e0d7e8c0629Status: Downloaded newer image for bitbucketpipelines/jenkins-job-trigger:0.1.1WARNING: Could not find released pipe version for atlassian/jenkins-job-trigger. Data matched: {}INFO: Submitting jenkins job...✔ Pipe has finished successfully.@Sarath Nagarajan hi. Thanks for your question.
You received response 200 from your jenkins. Maybe:
Regards, Igor.
Thanks @Igor Stoyanov now i can see some debug logs where jenkins job is being called however there are certain redirections. May be the org policy etc that i'll check it internally
Just one other q. I am getting the below message
Traceback (most recent call last):
File "/pipe.py", line 145, in <module>
pipe.run()
File "/pipe.py", line 136, in run
self.wait_for_job(build_response.headers['Location'])
File "/usr/local/lib/python3.9/site-packages/requests/structures.py", line 54, in __getitem__
return self._store[key.lower()][1]
KeyError: 'location'
Any idea?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Sarath Nagarajan hi. By default jenkins response is something like this:
HTTP/1.1 201 Created
Location: http://localhost:8080/queue/item/16/
In your case seems like no `Location` header present in response.
Regards, Igor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got your point. so if the redirect issue is fixed then i think this can be resolved
i'll try and keep you posted.
BTW. Thank you so much for your responses
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
All worked thanks for your help @Igor Stoyanov
problem was with the URL used .. there is a proxy'd one that i am suppose to use... and that did the magic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.