Tags are mostly read-only, so I'm not sure what you're trying to do with 
"detect new commits" in specific tag.  You can probably say "trigger builds 
for any new tag that matches tags/develop/*" and your tags have to be 
"develop/v1", "develop/v2", etc.

On Thursday, March 23, 2017 at 2:45:05 AM UTC-7, Stefano Tranquillini wrote:
>
> 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/a81f4ec6-8b37-414f-9838-765ca44de431%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to