Not able to use Jenkins labels in pipelines

12,017

Try the following syntax for the pipeline:

node("poolA"){

    echo "Jenkins pipeline for rapidx node"

}
Share:
12,017
NicolasW
Author by

NicolasW

Updated on June 04, 2022

Comments

  • NicolasW
    NicolasW over 1 year

    I can't get Jenkins labels to work in Jenkins while using pipelines.

    My node is defined with a label say "poolA", and the following pipeline should attempt to run on that node but it doesn't.

    Any ideas why?

    Console says:

    MyAgentis reserved for jobs with matching label expression; Jenkins
    is reserved for jobs with matching label expression
    

    This is my pipeline:

    node{
        label 'poolA'
        echo " jenkins pipeline for rapidx node" 
    }
    

    My node is defined as follows:

    • Only build job with label expression ....
    • Launch method : Java webstart
    • Avail : Keep this agent online as much as possible
    • Executors # : 1
    • Other settings unchanged

    Note that I am behind a firewall (no internet access during execution) using Jenkins 2.73.2

    This is a clean install of jenkins on windows, the only change I made was to enable Java web start.

  • NicolasW
    NicolasW about 6 years
    Thanks, the double quote helped on a clean install, but on my main instance I now have "(pending—master is offline)" - any clues?
  • NicolasW
    NicolasW about 6 years
    added that new question in stackoverflow.com/questions/46833618/…