I am trying to run a Jenkins pipeline and I just keep getting the error:
Jenkins doesn't have label 'linux'
Any idea why this is happening? Is it a plugin I am missing?
pipeline {
agent{
label 'linux'
}
stages {
stage('Checkout Code') {
steps {
checkout scm
}
}
stage('Build Docker Container') {
steps {
script {
sh "ls -ltr"
env.HARBORHOST ="harbour.com"
env.REGISTRY = "securewbs"
env.IMAGE = "${env.HARBORHOST}/${env.REGISTRY}/securewbs:${env.BUILD_NUMBER}"
wbs = docker.build("${env.IMAGE}")
}
}
}
Go to Manage Jenkins->Manage Nodes. You can chose one of these nodes as your agent. Take the string from the column "name". If the name of one of your nodes is for example "master" you can write:
pipeline {
agent {
label 'master'
}
...
}
Look at the configuration section of your Jenkins instance (https://your-jenkins/configure). There is a section called Lockable Resources Manager
, and your 'linux' label should be listed here.
The label is a selection field.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With