-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
91 lines (76 loc) · 1.81 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
parallel (
"conda":{
node('linux_conda') {
stage('init') {
gitlabCommitStatus("init") {
checkout scm
}
}
stage('mamba') {
gitlabCommitStatus("mamba") {
sh "make mamba-env-update"
}
}
stage('test') {
gitlabCommitStatus("test") {
sh "mamba run -n pdaltools make testing"
}
}
stage('build') {
gitlabCommitStatus("build") {
if (env.BRANCH_NAME == 'master') {
sh "mamba run -n pdaltools make build"
} else {
echo "Nothing to do, because branch is not master"
}
}
}
stage('deploy') {
gitlabCommitStatus("deploy") {
if (env.BRANCH_NAME == 'master') {
sh "mamba run -n pdaltools make check"
withCredentials([usernamePassword(credentialsId: 'pypi', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh "mamba run -n pdaltools twine upload dist/* -u ${USERNAME} -p ${PASSWORD}"
}
} else {
echo "Nothing to do, because branch is not master"
}
}
}
}
},
"docker":{
node('DOCKER') {
stage('build-docker-image') {
gitlabCommitStatus("build-docker-image") {
if (env.BRANCH_NAME == 'master') {
checkout scm
sh "make docker-build"
} else {
echo "Nothing to do, because branch is not master"
}
}
}
stage('test-docker-images') {
gitlabCommitStatus("test-docker-images") {
if (env.BRANCH_NAME == 'master') {
sh "./script/test/test_docker_output.sh"
} else {
echo "Nothing to do, because branch is not master"
}
}
}
stage('deploy-docker-image') {
gitlabCommitStatus("build-docker-image") {
if (env.BRANCH_NAME == 'master') {
withCredentials([string(credentialsId: 'svc_lidarhd', variable: 'svc_lidarhd')]) {
sh "docker/deploy-jenkins.sh ${svc_lidarhd}"
}
} else {
echo "Nothing to do, because branch is not master"
}
}
}
}
}
)