Skip to content

Instantly share code, notes, and snippets.

@ssbostan
Last active September 7, 2021 10:51
Show Gist options
  • Save ssbostan/1f5b3288a7f5535ad8e719d667ef36b2 to your computer and use it in GitHub Desktop.
Save ssbostan/1f5b3288a7f5535ad8e719d667ef36b2 to your computer and use it in GitHub Desktop.
Jenkins pipeline syntax reference
pipeline {
agent any
environment {
MYUSERPASS = credentials("test-user-pass")
}
stages {
stage("Test") {
steps {
// Do not use " for command methods like sh, bat, powershell, pwsh, etc.
// Use ' to avoid groovy interpolation and command injection vulnerabilities.
sh 'echo $MYUSERPASS'
sh 'logintest --username $MYUSERPASS_USR --password $MYUSERPASS_PSW'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment