ruby-ex/deployment/pipeline.groovy

31 lines
800 B
Groovy
Raw Normal View History

2016-12-16 10:34:37 +00:00
@Library('ocutil') _
node() {
2016-12-09 15:48:52 +00:00
stage("Checkout") {
2016-12-07 22:21:17 +00:00
git "https://github.com/omallo/ruby-ex.git"
2016-12-09 15:48:52 +00:00
}
2016-12-09 15:41:36 +00:00
2016-12-16 10:39:52 +00:00
def config = ocutil.parseYaml(readFile("deployment/config.yaml"))
2016-12-09 14:55:28 +00:00
2016-12-09 15:48:52 +00:00
stage("Build") {
2016-12-16 09:22:40 +00:00
ocBuild("rubex-dev", "frontend", config.dev.build.frontend)
2016-12-05 14:32:22 +00:00
}
2016-12-09 15:48:52 +00:00
stage("Deploy to DEV") {
2016-12-15 17:02:48 +00:00
ocTag("rubex-dev", "frontend", "latest", "dev")
ocDeploy("rubex-dev", "frontend", config.dev.deployment.frontend)
2016-12-05 14:32:22 +00:00
}
def isPromoteToTest = false
2016-12-09 13:33:03 +00:00
stage("Promote to TEST?") {
isPromoteToTest = input(message: "Promotion", parameters: [booleanParam(defaultValue: false, name: "Promote to TEST?")])
2016-12-05 14:32:22 +00:00
}
if (isPromoteToTest) {
2016-12-09 13:33:03 +00:00
stage("Deploy to TEST") {
2016-12-15 17:02:48 +00:00
ocTag("rubex-dev", "frontend", "dev", "test")
ocDeploy("rubex-test", "frontend", config.test.deployment.frontend)
2016-12-05 14:32:22 +00:00
}
2016-12-09 15:48:52 +00:00
}
2016-12-05 14:32:22 +00:00
}