If you'd like labels assigned automatically to your agents, install the "Platform Labeler Plugin <https://plugins.jenkins.io/platformlabeler>".
If the labels assigned by the platform labeler plugin are not generic enough, install the "Implied Labels Plugin <https://plugins.jenkins.io/implied-labels>" and you can define that all agents with the label "CentOS" should also be assigned the label "linux" (as an example). It simplifies the management of labels. If you'd like an example implied labels definition for various Linux operating systems, I have one in my docker repository <https://github.com/MarkEWaite/docker-lfs/blob/4a9773f22066c9db6fa7841fcbcfb14dacd26918/ref/org.jenkinsci.plugins.impliedlabels.Config.xml#L8> . On Mon, May 20, 2019 at 6:18 AM Bob TheBuilder <thebuilderb...@gmail.com> wrote: > Hi Gregory, > > what kind of Jenkinsfile do you use? Scripted or declarative? > In scripted, you would enclose your sh in a > >> node('linux_label') { >> sh "your shell script" >> } > > > , on declarative, use > stage ("Run on Linux only") { > agent { label "linux_label" } > steps { > script { > sh "you shell script" > } > } > > with agent('linux_label'). Linux label would be a label you attached to > the Linux slave/node > > -- > 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/e81a95b4-d8a4-4fa0-931a-f314e9616796%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/e81a95b4-d8a4-4fa0-931a-f314e9616796%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Thanks! Mark Waite -- 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/CAO49JtFJYtp5ZGSCnKmGAMbJt%2BOtg%3DXAT9jBN%3D-KRY8aQDoWig%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.