Hi all,
i've a pipeline that runs for my code, now, I work with Bitbucket and I
found a way to start the pipeline via the webhook, the problem is that it
builds every push, which I don't want.
What I would like is that it build everythime the tag "develop" is pushed
to the remote and there are new commits.
The BitBucket webhook is raised every push, so I need to modify the pipe in
order to avoid building if there are no new commits in that speciic tag.
node{
properties([disableConcurrentBuilds(), buildDiscarder(logRotator(
artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '',
numToKeepStr: '10')), parameters([string(defaultValue: '...', description:
'', name: 'CUSTOMER_ID'), string(defaultValue: 'Develop', description: '',
name: 'BUILD_ID'), string(defaultValue: '...', description: '', name:
'CUSTOMER_KEY')])], pipelineTriggers([[$class: 'BitBucketTrigger']])
stage('checkout'){
checkout([$class: 'GitSCM', branches: [[name: '*/tags/develop'
]], doGenerateSubmoduleConfigurations: false, extensions: [[$class:
'SubmoduleOption', disableSubmodules: false, parentCredentials: true,
recursiveSubmodules: true, reference: '', trackingSubmodules: false]],
submoduleCfg: [], userRemoteConfigs: [[credentialsId: '.....', refspec:
'+refs/tags/*:refs/remotes/origin/tags/*', url: 'REMOTEURL']]])
}
stage('setup'){
....
}
}
How can I write an If for the checkout to say: exit if there are new
commits or keep going if there's a new commit compared to last build??
PS: if i will have tags with version, so develop-1 develop-2, and I'll
change the branch to '*/tags/develop*' which branch will be built?
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/a7002e0d-7202-433b-be41-885d1cebd881%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.