Jenkins: Can comments be added to a Jenkinsfile? Jenkins: Can comments be added to a Jenkinsfile? jenkins jenkins

Jenkins: Can comments be added to a Jenkinsfile?


The Jenkinsfile is written in groovy which uses the Java (and C) form of comments:

/* this   is a   multi-line comment */// this is a single line comment


You can use block (/***/) or single line comment (//) for each line. You should use "#" in sh command.

Block comment

/*  post {    success {      mail to: "XXXXX@gmail.com",       subject:"SUCCESS: ${currentBuild.fullDisplayName}",       body: "Yay, we passed."    }    failure {      mail to: "XXXXX@gmail.com",       subject:"FAILURE: ${currentBuild.fullDisplayName}",       body: "Boo, we failed."    }  }*/