Hot answers tagged

6

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 ...


4

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


3

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 ...


3

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 ...


3

This is a known bug. See JENKINS-42878 and JENKINS-41996. This bug has been resolved upstream, which means you should be able to fix the bug by upgrading the plugin to the latest version.


3

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 ...


2

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.


2

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.


2

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')


1

Based on this PR, the repoSlug was added and now the status is sent to the right repository. When it was not working: post { success { bitbucketStatusNotify( buildState: 'SUCCESSFUL', commitId: env.GIT_COMMIT ) } failure { bitbucketStatusNotify( ...


1

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