-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdeploy.Jenkinsfile
35 lines (35 loc) · 1.21 KB
/
deploy.Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
pipeline {
agent {
dockerfile {
dir 'jenkins'
label 'docker'
// Required for the serverless-python-requirements plugin to install
// Python requirements using the AWS build images, running Docker inside 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 {
// Set HOME to the workspace for the serverless-python-requirements plugin.
// The plugin uses HOME for its default cache location, which needs to be
// mounted in the separate Python build container. This needs to be an absolute
// path that also exists on the host since we're mounting the Docker socket.
HOME = "${env.WORKSPACE}"
}
options {
ansiColor('xterm')
}
parameters {
choice(name: 'ENVIRONMENT', choices: ['staging', 'production'],
description: 'The target environment to deploy to.')
}
stages {
stage('deploy') {
steps {
withAWS(role:'r-builds-deploy') {
sh "make serverless-deploy.${params.ENVIRONMENT}"
}
}
}
}
}