Home > other >  Jenkins pipeline script not running
Jenkins pipeline script not running

Time:02-24

For the below pipeline script, "Helo World" is not printing. And even node is not getting allocated.

pipeline {
    agent any
    stages {
        stage('Example') {
            steps {
                echo 'Hello World'
            }
        }
    }
}

enter image description here

CodePudding user response:

Naveen, Could you try below

pipeline {
    agent {label '**Add agent name here**'} //ex: root
       stages {
           stage('Example'){
                 steps {
                       echo "Hello World"

                }    

          } 
    
    }

}

enter image description here

CodePudding user response:

Installed "Pipeline: Declarative" plugin (to run declarative Pipeline scripts) and this worked.

  • Related