Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Hot answers tagged


You don't make any mention of the scripting language you want to use, so I will talk specifically about the HTTP requests to the BitBucket API: Assumptions If you have a BitBucket Repository that has three commits in in it the first and the last are failing the build, the middle is passing: 4768815 ❌ 49d7110 ✅ 42d357f ❌ Get the list of commits You can ...


I believe it is now possible to configure the webhook on per-repo basis: https://mohamicorp.atlassian.net/wiki/spaces/DOC/pages/381419546/Configuring+Webhook+To+Jenkins+for+Bitbucket+Bitbucket+Branch+Source+Plugin


In a typical Continuous Delivery/Deployment pipeline you would have the following happen: Developer pushes one or more commits, or, a pull request is merged. Jenkins automatically builds and executes tests. If successful Jenkins publishes a deployment package to an Artefact Repository; if failure publishes nothing and notify developers. Deployment ...


One could update the build status in bitbucket as follows: Adding a build result to a commit To associate a build result with a particular commit, you need to POST a JSON object to the build status REST resource at: https://<bitbucket-base-url>/rest/build-status/1.0/commits/<commit-hash> The format of the JSON object that ...


If you just need generic post-receive hooks, you can just do a regular web hook and hit the build API endpoint. For instance, if the name of your Jenkins server is jenkins.example.com and the name of the Pipeline job to trigger is my_awesome_job, then you can fire off a POST request to https://jenkins.example.com/job/my_awesome_job/build. Depending on your ...


To expand on the answer above - try using: branch: "origin/pr/${pullRequestId}/from" Because in groovy, string interpolation is not done for simple strings - i.e. strings within single quotes. See http://groovy-lang.org/syntax.html#_string_interpolation for details on that.


In groovy script, you need to reference environment variables in a different way than in bash. So probably this line is causing trouble: branch: ('origin/pr/${pullRequestId}/from') Try using: branch: ('origin/pr/' + env.pullRequestId + '/from')


You could: prune your branches. (guessing you'd have done this by now if feasible.) implement Jenkinsfile, a code-driven pipeline, and simply remove the jenkinsfile from the branches you don't want built or triggered by SCM-polling.


One could use SCM polling and specify different branches that need to be polled.

Only top voted, non community-wiki answers of a minimum length are eligible