-
-
Save ifiok/b59127856d52f8bb3563014d61e908d9 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