Skip to content

Instantly share code, notes, and snippets.

@pporada-gl
Created October 27, 2016 22:29
Show Gist options
  • Save pporada-gl/7d27727dc80173d0f3d594321c3f4aac to your computer and use it in GitHub Desktop.
Save pporada-gl/7d27727dc80173d0f3d594321c3f4aac to your computer and use it in GitHub Desktop.
Jenkinsfile example
$ cat Jenkinsfile
#!/usr/bin/env groovy
node {
git credentialsId: '4sdjfsdkjbfgksjdbfksjdbfkjsdbfkjsdbfjkbsdfb', url: '[email protected]:/terraform-autobot.git'
withEnv(["SOURCE_BUILD_NUMBER=${env.BUILD_NUMBER}"]) {
sh '''#!/bin/bash
echo $SOURCE_BUILD_NUMBER
echo "======="
FOO=BAR
echo ${FOO}
if [ ${FOO} == "BAR" ]; then echo hi; else echo hey; fi
'''
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment