Skip to content

Instantly share code, notes, and snippets.

@ssbostan
Last active September 7, 2021 10:51
Show Gist options
  • Save ssbostan/58226ff493b1ab69c91b3b713690eacf to your computer and use it in GitHub Desktop.
Save ssbostan/58226ff493b1ab69c91b3b713690eacf to your computer and use it in GitHub Desktop.
Jenkins pipeline syntax reference
pipeline {
agent any
environment {
SAMPLE_ENV = credentials("simple-secret-text")
}
stages {
stage("Release") {
steps {
// Do not use " for command methods like sh, bat, powershell, pwsh, etc.
// Use ' to avoid groovy interpolation and command injection vulnerabilities.
sh 'example --secret $SAMPLE_ENV'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment