forked from vg-mjg/majsoul-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
44 lines (39 loc) · 1.09 KB
/
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
36
37
38
39
40
41
42
43
44
pipeline {
agent any
environment {
MAJSOUL_SECRETS = credentials('majsoul_secrets')
RIICHI_CERT = credentials('riichi_cert')
RIICHI_KEY = credentials('riichi_key')
MONGO_CREDS = credentials('mongo_creds')
}
stages {
stage('docker compose') {
steps {
sh 'touch majsoul.env'
sh 'docker-compose build'
}
}
stage('docker down') {
steps {
sh 'docker stack down majsoul'
sh '''
until [ -z "$(docker service ls --filter label=com.docker.stack.namespace=majsoul -q)" ] || [ "$limit" -lt 0 ]; do
sleep 1;
done
until [ -z "$(docker network ls --filter label=com.docker.stack.namespace=majsoul -q)" ] || [ "$limit" -lt 0 ]; do
sleep 1;
done
'''
}
}
stage('docker stack') {
steps {
sh 'cp ${MAJSOUL_SECRETS} secrets.json'
sh 'cp ${RIICHI_CERT} riichi.crt.pem'
sh 'cp ${RIICHI_KEY} riichi.key.pem'
sh 'cp ${MONGO_CREDS} mongo-creds'
sh 'docker stack up -c docker-compose.yaml majsoul'
}
}
}
}