QT-DevOps / DevOpsIssues

This Repo will be used to demonstrate the Skills & Questions in DevOps
Apache License 2.0
27 stars 131 forks source link

Unable to run Jenkins pipeline on Jenkins master node #1006

Open prrohith opened 3 years ago

prrohith commented 3 years ago

Hi,

I am trying to run jenkins pipeline on jenkins master node by give "agent none" as below but it fails as below. I also tried agent{none}, agent{label 'none'}. It didn't work, but I am able to run on nodes using agent{label 'ltecomm'}. Can you help?

ERROR: Attempted to execute a step that requires a node context while ‘agent none’ was specified. Be sure to specify your own ‘node { ... }’ blocks when using ‘agent none’. Finished: FAILURE

Script used:

pipeline{ agent none stages{ stage('scm'){ steps{ git 'https://github.com/wakaleo/game-of-life.git' } } stage('build'){ steps{ sh script: 'mvn clean package' } } stage('post build'){ steps{ junit 'gameoflife-web/target/surefire-reports/.xml' archiveArtifacts 'gameoflife-web/target/.war' } } } }