I have a Bitbucket pipeline with Jenkins Job Trigger Integration using WAIT variable.
- When the Jenkins pipeline is created by a BuildConfig: POST returns status code 302 and then the Bitbucket pipeline fails.
The Jenkins pipeline runs successfully. When I don't use WAIT, the Bitbucket pipeline also runs successfully.
- When the Jenkins pipeline is created manually: POST returns 201 and the Bitbucket pipeline can wait and completes successfully.
Logs:
**********ERROR**********
DEBUG: Starting new HTTPS connection (1): bitbucket.org:8080
INFO: None
INFO: Submitting jenkins job...
DEBUG: Starting new HTTPS connection (1): jenkins-env.apps.com:8080
Traceback (most recent call last):
File "/pipe.py", line 187, in <module>
pipe.run()
File "/pipe.py", line 178, in run
self.wait_for_job(build_response.headers['Location'])
File "/usr/local/lib/python3.10/site-packages/requests/structures.py", line 52, in __getitem__
return self._store[key.lower()][1]
KeyError: 'location'
**********OK**********
DEBUG: Starting new HTTPS connection (1): bitbucket.org:8080
INFO: None
INFO: Submitting jenkins job...
DEBUG: Starting new HTTPS connection (1): jenkins-env.apps.com:8080
DEBUG: Starting new HTTPS connection (1): jenkins-env.apps.com:8080
INFO: Jenkins build not started yet: In the quiet period. Expires in 0.94 sec
DEBUG: Starting new HTTPS connection (1): jenkins-env.apps.com:8080
DEBUG: Starting new HTTP connection (1): jenkins-env.apps.com:80
DEBUG: Starting new HTTPS connection (1): jenkins-env.apps.com:8080
✔ Jenkins build with number 65 has finished successfully.
✔ Pipe has finished successfully.
Thanks!