shift deploy to separate job
This commit is contained in:
parent
1b347c9714
commit
0016ba2f4b
2 changed files with 30 additions and 9 deletions
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
|
|
@ -23,19 +23,13 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('deploy') {
|
stage('deploy') {
|
||||||
agent {
|
agent none
|
||||||
dockerfile {
|
|
||||||
dir 'jenkins'
|
|
||||||
label 'docker-4x'
|
|
||||||
additionalBuildArgs '--build-arg DOCKER_GID=$(stat -c %g /var/run/docker.sock) --build-arg JENKINS_UID=$(id -u jenkins) --build-arg JENKINS_GID=$(id -g jenkins)'
|
|
||||||
args '-v /var/run/docker.sock:/var/run/docker.sock --group-add docker'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
when {
|
when {
|
||||||
branch 'master'
|
branch 'master'
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh 'make serverless-deploy.production'
|
build(job: 'hostedapps/deploy/r-builds', wait: true,
|
||||||
|
parameters: [string(name: 'ENVIRONMENT', value: 'staging')])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
27
deploy.Jenkinsfile
Normal file
27
deploy.Jenkinsfile
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
dockerfile {
|
||||||
|
dir 'jenkins'
|
||||||
|
label 'docker'
|
||||||
|
additionalBuildArgs '--build-arg DOCKER_GID=$(stat -c %g /var/run/docker.sock) --build-arg JENKINS_UID=$(id -u jenkins) --build-arg JENKINS_GID=$(id -g jenkins)'
|
||||||
|
args '-v /var/run/docker.sock:/var/run/docker.sock --group-add docker'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
environment {
|
||||||
|
HOME = "."
|
||||||
|
}
|
||||||
|
options {
|
||||||
|
ansiColor('xterm')
|
||||||
|
}
|
||||||
|
parameters {
|
||||||
|
choice(name: 'ENVIRONMENT', choices: ['staging', 'production'],
|
||||||
|
description: 'The target environment to deploy to.')
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('deploy') {
|
||||||
|
steps {
|
||||||
|
sh 'make serverless-deploy.${params.ENVIRONMENT}'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue