Issue/question with Pipeline and SCM

56 views
Skip to first unread message

SamL

unread,
May 9, 2017, 12:54:38 PM5/9/17
to Jenkins Users
Hello Folks

I have this simple Pipeline script

pipeline {
    agent none

    stages {
        stage ('Check out the Code') {
            agent { label 'Axis' }
            steps {  
                echo 'Checking out Source from Mercurial'
                checkout changelog: true, scm: [$class: 'MercurialSCM', browser: [$class: 'HgWeb', url: MercUrl], clean: true, credentialsId: '', installation: '(Default)', revision: myRev, source: MercRepo]
            }
        }
    }
}

I expected it to do the checkout on the agent  but it does not; it is doing the checkout on  the Master.

What I am missing, or am I trying to do something is not possible.

Thank you very much for your help.

Sam

jer...@bodycad.com

unread,
May 9, 2017, 2:19:13 PM5/9/17
to Jenkins Users
How is your slave labels configured?

If nothing match is found, I think the code run on the master. Also make sure the master node doesn't have the labels Axis. You also may want to change the usage of each node (node configuration). May want to mark your master to be used only when matching and your slave to be used as much as possible.

SamL

unread,
May 9, 2017, 3:21:21 PM5/9/17
to Jenkins Users
Thank you very much for  the reply

The slave has the Label Axis on its configuration.
Slave is already configured to be used as much as possible.


I have put a label on the Master and configure it so then only jobs matching the name run in it.

But sadly the results are the same.

Jérôme Godbout

unread,
May 9, 2017, 3:28:25 PM5/9/17
to jenkins...@googlegroups.com
Because if both master and slave have the Axis labels and both are setup to be used, there's multiples option to build, the first free may be taken (in your case probably the master is taken). Maybe there's a bug into the usage (
'use as much as possible' and the 'only use when labels match') but all your master/slave should be set to  'Only used this...'. So your label will define where this can be used.

You may want to add a label 'slave' 'master' on your node and make sure the master is not selected or remove the Axis label from your master.

bodycad
Jerome Godbout
Software Developer
2035 rue du Haut-Bord, Québec, QC, Canada. G1N 4R7
T:  +1 418 527-1388
E: jer...@bodycad.com
www.bodycad.com

The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited. 

Le contenu de ce message et les pièces jointes sont destinés uniquement pour le(s) destinataire(s) et peuvent contenir des informations confidentielles et / ou privilégiées qui peuvent être protégées légalement contre toute divulgation. Si vous n'êtes pas le destinataire de ce message ou son agent, ou si ce message vous a été adressé par erreur, s’il vous plaît avertir immédiatement l'expéditeur par courriel de réponse, puis supprimer ce message et les pièces jointes. Si vous n'êtes pas le destinataire prévu, vous êtes par la présente informé que toute utilisation, diffusion, copie, ou stockage de ce message ou de ses pièces jointes est strictement interdit.


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/B654VmMocf4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e641129e-ae0c-4058-87ab-8cd7b9bdf1b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

SamL

unread,
May 9, 2017, 3:30:10 PM5/9/17
to Jenkins Users
One more thing when I look at the log output it says that it is running on the slave with the specified label. Yet the SCM step gets executed on the Master

SamL

unread,
May 9, 2017, 7:00:33 PM5/9/17
to Jenkins Users
The  label Axis is not in the Master

At the moment I have the Master and one agent

The Master has the label  'Master' and  Only build jobs with label expressions matching this nose
The Agent has the label 'Axis' and  Use this node as much as possible
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.

Jérôme Godbout

unread,
May 9, 2017, 9:45:18 PM5/9/17
to jenkins...@googlegroups.com
Sounds like a bug into declarative pipeline and the agent. I'm no declarative pipeline, so you may want to check the agent doc to know if the position is correct into the script.
Reply all
Reply to author
Forward
0 new messages