Can you try this:

node('sles12') {
    stage name: 'checkout'
        git 'https://github.com/acme/makefiles.git'
        git url: 'https://github.com/acme/software.git', branch: env.BRANCH_NAME
        sh 'echo `hostname`'
  }


On Wed, Sep 14, 2016 at 12:50 AM, Paul Chubatyy <x...@citylance.biz> wrote:

> Good morning,
>
> I'm creating a small pipeline script that has multiple stages on the node
> to be executed:
>
> node('sles12') {
>     stage('checkout') {
>         git 'https://github.com/acme/makefiles.git'
>         git url: 'https://github.com/acme/software.git', branch: 
> env.BRANCH_NAME
>         sh 'echo `hostname`'
>     }
> }
>
>
> But Jenkins executes the actions on master node instead of slave. Although
> it sends me a mixed message in output:
>
> *22:17:46* Running on *sles12-slave2* in /jenkins/workspace/software/master   
>     <--------- This seems correct[Pipeline] {[Pipeline] stage[Pipeline] { 
> (checkout)[Pipeline] git*22:17:46*  > git config remote.origin.url 
> https://github.com/acme/makefiles.git # timeout=10 <--------- But checkouts 
> happen on master node*22:17:46* Fetching upstream changes from 
> https://github.com/acme/makefiles.git
>
> ......Checks out the particular revision.........
>
> [Pipeline] git *22:17:46* > git config remote.origin.url
> https://github.com/acme/software.git # timeout=10 *22:17:47* Fetching
> upstream changes from https://github.com/acme/software.git ......Checks
> out the particular revision......... *22:17:47* First time build.
> Skipping changelog. [Pipeline] sh *22:17:47* [master] Running shell
> script *22:17:47* + hostname *22:17:47* + echo `hostname` *22:17:47* 
> *jenkins-master
> *<------------- This is master node [Pipeline] }
>
>
>
> Please advise what am I doing wrong here and how can I make Jenkins to 
> execute my git checkouts and shell commands on the node labeled sles12 
> instead of master.
>
>
> Thanks!
>
> --
> 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-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-users/96f75a5f-7e4a-4e9b-a2dd-1756ad6546eb%40googlegroups.
> com
> <https://groups.google.com/d/msgid/jenkinsci-users/96f75a5f-7e4a-4e9b-a2dd-1756ad6546eb%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Regards
nirish okram

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPzcO4je0QVni55oPJO4hBE0K%3DAG3n856asAJsJxX1LdzgEgeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to