-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
66 lines (66 loc) · 2.04 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
pipeline {
agent none
environment {
DOCKER_BUILDKIT = 1
}
stages {
stage('geo-algo') {
agent {
dockerfile {
filename 'docker/Dockerfile.build'
}
}
steps {
dir('geo-algo/VK-Aquifers') {
sh '''#!/bin/bash --login
conda activate geocruncher
cmake -DCMAKE_BUILD_TYPE=Release .
cmake --build .
'''
sh './viskar-geo-algo runTests'
}
}
}
stage('geocruncher & api') {
agent {
dockerfile {
filename 'docker/Dockerfile.common'
}
}
steps {
withEnv(["HOME=${env.WORKSPACE}"]) {
// TODO: Setuptools is deprecated and doesn't work anymore
// replace with something else, then enable tests again
// sh 'python geocruncher-setup.py test'
sh '''#!/bin/bash --login
conda activate geocruncher
python geocruncher-setup.py bdist_wheel
python api-setup.py bdist_wheel
'''
// Apparently not needed since the files are already where we want them to be
// sh 'cp dist/geocruncher-*.whl dist/'
// sh 'cp dist/api-*.whl dist/'
}
}
}
stage('develop image') {
agent any
when { anyOf { branch 'develop' } }
steps {
sh 'docker build -t geocruncher/geocruncher-dev:$BUILD_NUMBER -t geocruncher/geocruncher-dev:latest -f docker/server.Dockerfile .'
sh 'sudo systemctl restart geocruncher.dev'
sh 'sudo systemctl status geocruncher.dev --no-pager -l'
}
}
stage('master image') {
agent any
when { anyOf { branch 'master' } }
steps {
sh 'docker build -t geocruncher/geocruncher-prod:$BUILD_NUMBER -t geocruncher/geocruncher-prod:latest -f docker/server.Dockerfile .'
sh 'sudo systemctl restart geocruncher.prod'
sh 'sudo systemctl status geocruncher.prod --no-pager -l'
sh 'docker image prune --filter "until=1440h" -f' // clean all unused images until 60 days ago
}
}
}
}