Created
April 10, 2018 14:47
-
-
Save robertstettner/06562142b8578057d485e8e34bc9172f to your computer and use it in GitHub Desktop.
Example Jenkinsfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
stages { | |
stage("install") { | |
agent { | |
docker { | |
reuseNode true | |
image 'node:6.10' | |
} | |
} | |
steps { | |
sh 'npm install' | |
} | |
} | |
stage("test") { | |
agent { | |
docker { | |
reuseNode true | |
image 'node:6.10' | |
} | |
} | |
steps { | |
sh 'npm test' | |
} | |
} | |
stage("deploy") { | |
when { | |
branch "master" | |
} | |
agent { | |
docker { | |
reuseNode true | |
image 'hashicorp/terraform' | |
args '--entrypoint=""' | |
} | |
} | |
steps { | |
sh ''' | |
cd ./terraform | |
terraform apply -auto-approve | |
''' | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment