forked from MaastrichtU-IDS/d2s-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
41 lines (41 loc) · 934 Bytes
/
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
pipeline {
agent any
options {
skipDefaultCheckout true
}
stages {
stage('checkout') {
when {
branch 'master'
}
steps {
git 'https://github.com/MaastrichtU-IDS/d2s-docs.git'
}
}
stage('build') {
when {
branch 'master'
}
steps {
sh 'docker build --no-cache -t umids/d2s-docs:latest .'
}
}
stage('deploy') {
when {
branch 'master'
}
steps {
parallel(
push: {
sh 'docker push umids/d2s-docs:latest'
},
deploy: {
sh 'docker stop d2s-docs || true'
sh 'docker rm d2s-docs || true'
sh 'docker run -d --name d2s-docs --restart unless-stopped -e VIRTUAL_HOST=d2s.semanticscience.org -e LETSENCRYPT_HOST=d2s.semanticscience.org -e VIRTUAL_PORT=3000 umids/d2s-docs:latest'
}
)
}
}
}
}