forked from axa-ch/web-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
56 lines (53 loc) · 1.48 KB
/
Jenkinsfile
File metadata and controls
56 lines (53 loc) · 1.48 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
node {
stage('Checkout') {
checkout scm
}
if (env.BRANCH_NAME == "v2") {
stage('Deploy') {
withCredentials([[
$class: 'UsernamePasswordMultiBinding',
credentialsId: 'rancher-workspace',
usernameVariable: 'RANCHER_ACCESS_KEY',
passwordVariable: 'RANCHER_SECRET_KEY'
], [
$class: 'UsernamePasswordMultiBinding',
credentialsId: 'amazon-s3',
usernameVariable: 'AWS_ACCESS_KEY_ID',
passwordVariable: 'AWS_SECRET_ACCESS_KEY'
], [
$class: 'StringBinding',
credentialsId: 'rancher-url',
variable: 'RANCHER_URL'
]]) {
sh """
set +x
export BASE_URL=/toolkit/v2
rancher-compose \
--file docker-compose.yml \
--url \$RANCHER_URL \
--access-key \$RANCHER_ACCESS_KEY \
--secret-key \$RANCHER_SECRET_KEY \
--project-name "web-toolkit-v2" \
--verbose up -d --confirm-upgrade
rancher-compose \
--file docker-compose.yml \
--url \$RANCHER_URL \
--access-key \$RANCHER_ACCESS_KEY \
--secret-key \$RANCHER_SECRET_KEY \
--project-name "web-toolkit-v2" \
--verbose up -d --upgrade
"""
}
}
} else {
stage('Build') {
sh """
set +x
export BASE_URL=/
docker-compose \
--file docker-compose.test.yml \
--verbose build web-toolkit
"""
}
}
}