Comments (9)
hi @mixMugz
here is a snippet working for me:
pipeline {
agent any
triggers {
bitBucketTrigger([
[
// $class: 'BitBucketPPRPullRequestTriggerFilter', // use this class for BitBucket Cloud instead.
$class: 'BitBucketPPRPullRequestServerTriggerFilter',
triggers: [
[
$class: 'BitBucketPPRPullRequestServerTriggerFilter',
actionFilter: [
$class: 'BitBucketPPRPullRequestCreatedActionFilter',
]
],
[
$class: 'BitBucketPPRPullRequestServerTriggerFilter',
actionFilter: [
$class: 'BitBucketPPRPullRequestApprovedActionFilter',
]
],
[
$class: 'BitBucketPPRPullRequestServerTriggerFilter',
actionFilter: [
$class: 'BitBucketPPRPullRequestUpdatedActionFilter',
]
],
[
$class: 'BitBucketPPRPullRequestServerTriggerFilter',
actionFilter: [
$class: 'BitBucketPPRPullRequestMergedActionFilter',
]
],
[
$class: 'BitBucketPPRRepositoryTriggerFilter',
actionFilter: [
$class: 'BitBucketPPRRepositoryPushActionFilter',
triggerAlsoIfNothingChanged: true,
triggerAlsoIfTagPush: false,
allowedBranches: ""
]
]
]
]
])
}
stages {
stage('Stage 1') {
steps {
echo 'Building...'
echo 'Env vars for cloud pull request...'
echo "BITBUCKET_SOURCE_BRANCH ${env.BITBUCKET_SOURCE_BRANCH}"
echo "BITBUCKET_TARGET_BRANCH ${env.BITBUCKET_TARGET_BRANCH}"
echo "BITBUCKET_PULL_REQUEST_LINK ${env.BITBUCKET_PULL_REQUEST_LINK}"
echo "BITBUCKET_PULL_REQUEST_ID ${env.BITBUCKET_PULL_REQUEST_ID}"
echo "BITBUCKET_PAYLOAD ${env.BITBUCKET_PAYLOAD}"
echo 'Env vars for cloud push...'
echo "REPOSITORY_LINK ${env.REPOSITORY_LINK}"
echo "BITBUCKET_SOURCE_BRANCH ${env.BITBUCKET_SOURCE_BRANCH}"
echo "BITBUCKET_REPOSITORY_URL ${env.BITBUCKET_REPOSITORY_URL}"
echo "BITBUCKET_PUSH_REPOSITORY_UUID ${env.BITBUCKET_PUSH_REPOSITORY_UUID}"
echo "BITBUCKET_PAYLOAD ${env.BITBUCKET_PAYLOAD}"
echo 'Env vars for server push...'
echo "REPOSITORY_LINK ${env.REPOSITORY_LINK}"
echo "BITBUCKET_SOURCE_BRANCH ${env.BITBUCKET_SOURCE_BRANCH}"
echo "BITBUCKET_REPOSITORY_URL ${env.BITBUCKET_REPOSITORY_URL}"
echo "BITBUCKET_PUSH_REPOSITORY_UUID ${env.BITBUCKET_PUSH_REPOSITORY_UUID}"
echo "BITBUCKET_PAYLOAD ${env.BITBUCKET_PAYLOAD}"
}
}
}
}
however I was forced to set a cron/interval-trigger in the multibranch root job, otherwise branches do not start automatically... @macghriogair is this intendend?
from bitbucket-push-and-pull-request-plugin.
I would also like an Update on this
from bitbucket-push-and-pull-request-plugin.
I seem to have the same issue,
- Multibranch Pipeline,
- latest jenkins and plugin
- BB Cloud
Tested multiple configurations. Everything is fine for branch builds. PR builds seem to be Skipped.
I've kinda tracked it down to the following discrepancy.
Job type for Multibranch Project is returned as: org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject
wheras the code here:
is checking for if it's an instance of MultiBranchProject. Which is actually the parent of WorkflowMultiBranchProject
scripted pipeline with the following config:
pipelineTriggers([
bitBucketTrigger([
[
$class: 'BitBucketPPRRepositoryTriggerFilter',
actionFilter: [
$class: 'BitBucketPPRRepositoryPushActionFilter',
allowedBranches: 'develop',
triggerAlsoIfNothingChanged: false,
triggerAlsoIfTagPush: false
]
],
[
$class: 'BitBucketPPRPullRequestTriggerFilter',
actionFilter: [
$class: 'BitBucketPPRPullRequestUpdatedActionFilter',
allowedBranches: ''
]
],
[
$class: 'BitBucketPPRPullRequestTriggerFilter',
actionFilter: [
$class: 'BitBucketPPRPullRequestCreatedActionFilter',
allowedBranches: ''
]
]
])
])
Log from the plugin, target branch name removed for being quite sensitive:
Job is of type: org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject
Bitbucket event is : push
Job Name : PR-134
sourceBranchName: null
Skipping for job:PR-134
EDIT: Reading up on java instanceof behaviour, this doesn't seem to be the cause of the issue. Might be something else within that check 🤔
from bitbucket-push-and-pull-request-plugin.
Hello, any updates on this?
from bitbucket-push-and-pull-request-plugin.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from bitbucket-push-and-pull-request-plugin.
I think I accidentally filed a bug for the same issue, but I may have found the cause. See last comment in: #123 (comment)
from bitbucket-push-and-pull-request-plugin.
I am also having an issue trying to use this plugin for multi-branch.
from bitbucket-push-and-pull-request-plugin.
Solved with release 2.5.1
from bitbucket-push-and-pull-request-plugin.
I am still getting it null
echo env.BITBUCKET_TARGET_BRANCH
echo env.BRANCH_NAME
echo env.BITBUCKET_SOURCE_BRANCH
00-00-0000 00:00:04.269 null
00-00-0000 00:00:04.282 [Pipeline] echo
00-00-0000 00:00:04.286 feature/sprint-1
00-00-0000 00:00:04.309 [Pipeline] echo
00-00-0000 00:00:04.313 null
from bitbucket-push-and-pull-request-plugin.
Related Issues (20)
- Webhook not triggering job HOT 5
- Bitbucket Pull Request Link is broken
- Build status not being communicated to Bitbucket HOT 2
- Multibranch pipeline does not start with PR Creation - webhook works correctly HOT 1
- NullPointerException occurs when webhook triggered HOT 4
- "Single triggered job" option. How does it work? HOT 7
- Pipeline executed from wrong branch when using Lightweight checkout HOT 2
- "Single triggered job" and local option "Single trigged repository" HOT 3
- NullPointerException: BitBucketPPRAction.getType() is null HOT 3
- can't get trigger on push to two branches
- [Request] Documentation on Bitbucket Cloud integration for build status propagation back to BB-cloud HOT 2
- Cannot get multibranch pipelines to trigger on push HOT 11
- bitbucket-push-and-pull-request-plugin stopped working with Bitbucket cloud HOT 8
- bitBucketPPRPluginConfig configuration as code
- Can not checkout merge commit in Jenkins Pipeline HOT 1
- Error making a pull request and the webhook it is trigger
- Upgrading from 2.8.3 to 3.0.2
- Cloud push trigger missing credentials when checking for changes
- ERROR: Could not find credentials entry with ID 'SOME_PIPELINE_PARAM_ID'
- Empty env BITBUCKET_PULL_REQUEST_LINK
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bitbucket-push-and-pull-request-plugin.