"Build whenever a SNAPSHOT dependency is built" with "Bitbucket Team/Project"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

"Build whenever a SNAPSHOT dependency is built" with "Bitbucket Team/Project"

Richard Hierlmeier

I tried to setup a bunch of maven jobs as "Bitbucket Team/Project". In the section "Scan Organization Folder Triggers" I selected the option "Build whenever a SNAPSHOT dependency is built".
In the Bitbucket project I have two GIT repos. One for module A and one for module B.
Module B has a Maven snapshot dependency to module A.
Bot repos have the following Jenkins file:

pipeline {
  agent {
    node {
        label 'maven'
    }
  }
  triggers {
      upstream(upstreamProjects: 'Nightly Build Trigger',
               threshold: hudson.model.Result.SUCCESS)
  }
  stages {
    stage('Build') {
       steps {
         withMaven(
            mavenLocalRepo: '.repository'
         ) {
                bat "mvn clean deploy"
            }
        }
    }
  }
}

However it seems that the "Build whenever a SNAPSHOT dependency is built" option has no effect.
If module A is built the built for module B is not triggered.
If in "View configuration" of the build job of a branch the option "Build whenever a SNAPSHOT dependency is built" is not selected.

Is this options siliently ingored by "Bitbucket Team/Project"?

Environment:

Jenkins 2.73.2
Jenkins Maven Plugin 3.0.7


Richard

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9f178deb-6157-47ee-85b3-88715bb5404b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Build whenever a SNAPSHOT dependency is built" with "Bitbucket Team/Project"

stephenconnolly

On Tue 9 Jan 2018 at 07:16, 'Richard Hierlmeier' via Jenkins Users <[hidden email]> wrote:

I tried to setup a bunch of maven jobs as "Bitbucket Team/Project". In the section "Scan Organization Folder Triggers" I selected the option "Build whenever a SNAPSHOT dependency is built".
In the Bitbucket project I have two GIT repos. One for module A and one for module B.
Module B has a Maven snapshot dependency to module A.
Bot repos have the following Jenkins file:

pipeline {
  agent {
    node {
        label 'maven'
    }
  }
  triggers {
      upstream(upstreamProjects: 'Nightly Build Trigger',
               threshold: hudson.model.Result.SUCCESS)

You need to configure a trigger here to have that take effect IIUC

  }
  stages {
    stage('Build') {
       steps {
         withMaven(
            mavenLocalRepo: '.repository'
         ) {
                bat "mvn clean deploy"
            }
        }
    }
  }
}

However it seems that the "Build whenever a SNAPSHOT dependency is built" option has no effect.
If module A is built the built for module B is not triggered.
If in "View configuration" of the build job of a branch the option "Build whenever a SNAPSHOT dependency is built" is not selected.

Is this options siliently ingored by "Bitbucket Team/Project"?

Environment:

Jenkins 2.73.2
Jenkins Maven Plugin 3.0.7


Richard

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9f178deb-6157-47ee-85b3-88715bb5404b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from my phone

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CA%2BnPnMz5QSkXw1sBD0YmrQ23zNG-FxikFiQn9x4VKecpv6CdoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Build whenever a SNAPSHOT dependency is built" with "Bitbucket Team/Project"

Richard Hierlmeier
In reply to this post by Richard Hierlmeier

Hi Stephen,

do you have an example for me how to define such a trigger?


Thank you

   Richard


Am Dienstag, 9. Januar 2018 08:16:06 UTC+1 schrieb Richard Hierlmeier:

I tried to setup a bunch of maven jobs as "Bitbucket Team/Project". In the section "Scan Organization Folder Triggers" I selected the option "Build whenever a SNAPSHOT dependency is built".
In the Bitbucket project I have two GIT repos. One for module A and one for module B.
Module B has a Maven snapshot dependency to module A.
Bot repos have the following Jenkins file:

pipeline {
  agent {
    node {
        label 'maven'
    }
  }
  triggers {
      upstream(upstreamProjects: 'Nightly Build Trigger',
               threshold: hudson.model.Result.SUCCESS)
  }
  stages {
    stage('Build') {
       steps {
         withMaven(
            mavenLocalRepo: '.repository'
         ) {
                bat "mvn clean deploy"
            }
        }
    }
  }
}

However it seems that the "Build whenever a SNAPSHOT dependency is built" option has no effect.
If module A is built the built for module B is not triggered.
If in "View configuration" of the build job of a branch the option "Build whenever a SNAPSHOT dependency is built" is not selected.

Is this options siliently ingored by "Bitbucket Team/Project"?

Environment:

Jenkins 2.73.2
Jenkins Maven Plugin 3.0.7


Richard

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/32982e93-e480-4d8c-9e20-5c5f3b8d9eda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Build whenever a SNAPSHOT dependency is built" with "Bitbucket Team/Project"

stephenconnolly
Snippet generator gives:

Inline images 1

So I'd guess you just add snapshotDependencies() to your triggers as you are using declarative syntax.

On 9 January 2018 at 06:54, 'Richard Hierlmeier' via Jenkins Users <[hidden email]> wrote:

Hi Stephen,

do you have an example for me how to define such a trigger?


Thank you

   Richard



Am Dienstag, 9. Januar 2018 08:16:06 UTC+1 schrieb Richard Hierlmeier:

I tried to setup a bunch of maven jobs as "Bitbucket Team/Project". In the section "Scan Organization Folder Triggers" I selected the option "Build whenever a SNAPSHOT dependency is built".
In the Bitbucket project I have two GIT repos. One for module A and one for module B.
Module B has a Maven snapshot dependency to module A.
Bot repos have the following Jenkins file:

pipeline {
  agent {
    node {
        label 'maven'
    }
  }
  triggers {
      upstream(upstreamProjects: 'Nightly Build Trigger',
               threshold: hudson.model.Result.SUCCESS)
  }
  stages {
    stage('Build') {
       steps {
         withMaven(
            mavenLocalRepo: '.repository'
         ) {
                bat "mvn clean deploy"
            }
        }
    }
  }
}

However it seems that the "Build whenever a SNAPSHOT dependency is built" option has no effect.
If module A is built the built for module B is not triggered.
If in "View configuration" of the build job of a branch the option "Build whenever a SNAPSHOT dependency is built" is not selected.

Is this options siliently ingored by "Bitbucket Team/Project"?

Environment:

Jenkins 2.73.2
Jenkins Maven Plugin 3.0.7


Richard

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/32982e93-e480-4d8c-9e20-5c5f3b8d9eda%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CA%2BnPnMwgxGS25ajB6tDw64E3ukKcn%3DVotgn%2B2S-evMPHsCvJCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Build whenever a SNAPSHOT dependency is built" with "Bitbucket Team/Project"

Richard Hierlmeier

Hi Stephen,

thank your for this hint. Here is the complete example for the Jenkins file:

#!groovy
pipeline
{
  agent any
  stages
{
    stage
('Build') {
       steps
{
         script
{
                properties
([pipelineTriggers([snapshotDependencies()])])
         
}
         withMaven
(
            mavenLocalRepo
: '.repository'
         
) {
                bat
"clean deploy"
           
}
       
}
   
}
}








Am Dienstag, 9. Januar 2018 14:54:00 UTC+1 schrieb Stephen Connolly:
Snippet generator gives:

Inline images 1

So I'd guess you just add snapshotDependencies() to your triggers as you are using declarative syntax.

On 9 January 2018 at 06:54, 'Richard Hierlmeier' via Jenkins Users <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="AH1_P1PYAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkins...@googlegroups.com> wrote:

Hi Stephen,

do you have an example for me how to define such a trigger?


Thank you

   Richard



Am Dienstag, 9. Januar 2018 08:16:06 UTC+1 schrieb Richard Hierlmeier:

I tried to setup a bunch of maven jobs as "Bitbucket Team/Project". In the section "Scan Organization Folder Triggers" I selected the option "Build whenever a SNAPSHOT dependency is built".
In the Bitbucket project I have two GIT repos. One for module A and one for module B.
Module B has a Maven snapshot dependency to module A.
Bot repos have the following Jenkins file:

pipeline {
  agent {
    node {
        label 'maven'
    }
  }
  triggers {
      upstream(upstreamProjects: 'Nightly Build Trigger',
               threshold: hudson.model.Result.SUCCESS)
  }
  stages {
    stage('Build') {
       steps {
         withMaven(
            mavenLocalRepo: '.repository'
         ) {
                bat "mvn clean deploy"
            }
        }
    }
  }
}

However it seems that the "Build whenever a SNAPSHOT dependency is built" option has no effect.
If module A is built the built for module B is not triggered.
If in "View configuration" of the build job of a branch the option "Build whenever a SNAPSHOT dependency is built" is not selected.

Is this options siliently ingored by "Bitbucket Team/Project"?

Environment:

Jenkins 2.73.2
Jenkins Maven Plugin 3.0.7


Richard

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="AH1_P1PYAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/32982e93-e480-4d8c-9e20-5c5f3b8d9eda%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/32982e93-e480-4d8c-9e20-5c5f3b8d9eda%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/32982e93-e480-4d8c-9e20-5c5f3b8d9eda%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/32982e93-e480-4d8c-9e20-5c5f3b8d9eda%40googlegroups.com.

For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9efce421-d691-46a1-a33c-abd05b8ca6ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Build whenever a SNAPSHOT dependency is built" with "Bitbucket Team/Project"

stephenconnolly
NOOOOOOO

you probably want more like

pipeline {
  agent {
    node {
        label 'maven'
    }
  }
  triggers {
      upstream(upstreamProjects: 'Nightly Build Trigger',
               threshold: hudson.model.Result.SUCCESS)
      snapshotDependencies()
  }
  stages {
    stage('Build') {
       steps {
         withMaven(
            mavenLocalRepo: '.repository'
         ) {
                bat "mvn clean deploy"
            }
        }
    }
  }
}

don't use a script block

On 9 January 2018 at 10:45, 'Richard Hierlmeier' via Jenkins Users <[hidden email]> wrote:

Hi Stephen,

thank your for this hint. Here is the complete example for the Jenkins file:

#!groovy
pipeline
{
  agent any
  stages
{
    stage
('Build') {
       steps
{
         script
{
                properties
([pipelineTriggers([snapshotDependencies()])])
         
}
         withMaven
(
            mavenLocalRepo
: '.repository'
         
) {
                bat
"clean deploy"
           
}
       
}
   
}
}








Am Dienstag, 9. Januar 2018 14:54:00 UTC+1 schrieb Stephen Connolly:
Snippet generator gives:

Inline images 1

So I'd guess you just add snapshotDependencies() to your triggers as you are using declarative syntax.

On 9 January 2018 at 06:54, 'Richard Hierlmeier' via Jenkins Users <[hidden email]> wrote:

Hi Stephen,

do you have an example for me how to define such a trigger?


Thank you

   Richard



Am Dienstag, 9. Januar 2018 08:16:06 UTC+1 schrieb Richard Hierlmeier:

I tried to setup a bunch of maven jobs as "Bitbucket Team/Project". In the section "Scan Organization Folder Triggers" I selected the option "Build whenever a SNAPSHOT dependency is built".
In the Bitbucket project I have two GIT repos. One for module A and one for module B.
Module B has a Maven snapshot dependency to module A.
Bot repos have the following Jenkins file:

pipeline {
  agent {
    node {
        label 'maven'
    }
  }
  triggers {
      upstream(upstreamProjects: 'Nightly Build Trigger',
               threshold: hudson.model.Result.SUCCESS)
  }
  stages {
    stage('Build') {
       steps {
         withMaven(
            mavenLocalRepo: '.repository'
         ) {
                bat "mvn clean deploy"
            }
        }
    }
  }
}

However it seems that the "Build whenever a SNAPSHOT dependency is built" option has no effect.
If module A is built the built for module B is not triggered.
If in "View configuration" of the build job of a branch the option "Build whenever a SNAPSHOT dependency is built" is not selected.

Is this options siliently ingored by "Bitbucket Team/Project"?

Environment:

Jenkins 2.73.2
Jenkins Maven Plugin 3.0.7


Richard

--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/32982e93-e480-4d8c-9e20-5c5f3b8d9eda%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9efce421-d691-46a1-a33c-abd05b8ca6ba%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CA%2BnPnMyC5zQtmyj9Z98J_iSqEnnkkAgzG0xPwsjPWM-xFX%2Bmsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: "Build whenever a SNAPSHOT dependency is built" with "Bitbucket Team/Project"

Richard Hierlmeier

Hi Stephen,

it works now, thank you for your help.

Am Dienstag, 9. Januar 2018 18:29:03 UTC+1 schrieb Stephen Connolly:
NOOOOOOO

you probably want more like

pipeline {
  agent {
    node {
        label 'maven'
    }
  }
  triggers {
      upstream(upstreamProjects: 'Nightly Build Trigger',
               threshold: hudson.model.Result.SUCCESS)
      snapshotDependencies()
  }
  stages {
    stage('Build') {
       steps {
         withMaven(
            mavenLocalRepo: '.repository'
         ) {
                bat "mvn clean deploy"
            }
        }
    }
  }
}

don't use a script block

On 9 January 2018 at 10:45, 'Richard Hierlmeier' via Jenkins Users <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="GoNWWg_kAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkins...@googlegroups.com> wrote:

Hi Stephen,

thank your for this hint. Here is the complete example for the Jenkins file:

#!groovy
pipeline
{
  agent any
  stages
{
    stage
('Build') {
       steps
{
         script
{
                properties
([pipelineTriggers([snapshotDependencies()])])
         
}
         withMaven
(
            mavenLocalRepo
: '.repository'
         
) {
                bat
"clean deploy"
           
}
       
}
   
}
}








Am Dienstag, 9. Januar 2018 14:54:00 UTC+1 schrieb Stephen Connolly:
Snippet generator gives:

Inline images 1

So I'd guess you just add snapshotDependencies() to your triggers as you are using declarative syntax.

On 9 January 2018 at 06:54, 'Richard Hierlmeier' via Jenkins Users <[hidden email]> wrote:

Hi Stephen,

do you have an example for me how to define such a trigger?


Thank you

   Richard



Am Dienstag, 9. Januar 2018 08:16:06 UTC+1 schrieb Richard Hierlmeier:

I tried to setup a bunch of maven jobs as "Bitbucket Team/Project". In the section "Scan Organization Folder Triggers" I selected the option "Build whenever a SNAPSHOT dependency is built".
In the Bitbucket project I have two GIT repos. One for module A and one for module B.
Module B has a Maven snapshot dependency to module A.
Bot repos have the following Jenkins file:

pipeline {
  agent {
    node {
        label 'maven'
    }
  }
  triggers {
      upstream(upstreamProjects: 'Nightly Build Trigger',
               threshold: hudson.model.Result.SUCCESS)
  }
  stages {
    stage('Build') {
       steps {
         withMaven(
            mavenLocalRepo: '.repository'
         ) {
                bat "mvn clean deploy"
            }
        }
    }
  }
}

However it seems that the "Build whenever a SNAPSHOT dependency is built" option has no effect.
If module A is built the built for module B is not triggered.
If in "View configuration" of the build job of a branch the option "Build whenever a SNAPSHOT dependency is built" is not selected.

Is this options siliently ingored by "Bitbucket Team/Project"?

Environment:

Jenkins 2.73.2
Jenkins Maven Plugin 3.0.7


Richard

--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/32982e93-e480-4d8c-9e20-5c5f3b8d9eda%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/32982e93-e480-4d8c-9e20-5c5f3b8d9eda%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/32982e93-e480-4d8c-9e20-5c5f3b8d9eda%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/32982e93-e480-4d8c-9e20-5c5f3b8d9eda%40googlegroups.com.

For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="GoNWWg_kAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/9efce421-d691-46a1-a33c-abd05b8ca6ba%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/9efce421-d691-46a1-a33c-abd05b8ca6ba%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/9efce421-d691-46a1-a33c-abd05b8ca6ba%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/9efce421-d691-46a1-a33c-abd05b8ca6ba%40googlegroups.com.

For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a21751bb-2c3e-44ae-898f-61df48f8774e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.