forked from opencb/opencga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
179 lines (165 loc) · 5.85 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
pipeline {
agent any
stages {
stage ('Validate ARM Templates') {
options {
timeout(time: 5, unit: 'MINUTES')
}
steps {
sh 'cd opencga-app/app/cloud/azure/arm && npx --ignore-existing armval "**/azuredeploy.json"'
}
}
stage ('Test ARM Scripts') {
options {
timeout(time: 5, unit: 'MINUTES')
}
steps {
sh 'cd opencga-app/app/cloud/azure/arm/scripts && docker build .'
}
}
stage ('Build opencga-storage-hadoop-deps') {
options {
timeout(time: 30, unit: 'MINUTES')
}
steps {
sh 'mvn clean install -DskipTests -f opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-deps -Dcheckstyle.skip'
}
}
stage ('Build With Hadoop Profile against hdp2.5') {
options {
timeout(time: 30, unit: 'MINUTES')
}
steps {
sh 'mvn clean install -DskipTests -Phdp2.5 -Dcheckstyle.skip'
}
}
stage ('Build With Hadoop Profile against hdp3.1') {
options {
timeout(time: 30, unit: 'MINUTES')
}
steps {
sh 'mvn clean install -DskipTests -Phdp3.1 -Dcheckstyle.skip'
}
}
stage ('Build With Hadoop Profile against hdp2.6') {
options {
timeout(time: 30, unit: 'MINUTES')
}
steps {
sh 'mvn clean install -DskipTests -Dstorage-mongodb -Dstorage-hadoop -Phdp2.6 -DOPENCGA.STORAGE.DEFAULT_ENGINE=hadoop -Dopencga.war.name=opencga -Dcheckstyle.skip'
}
}
stage ('Validate') {
options {
timeout(time: 5, unit: 'MINUTES')
}
steps {
sh 'mvn validate'
}
}
stage ('Build OpenCGA-Hadoop Docker Images') {
options {
timeout(time: 25, unit: 'MINUTES')
}
steps {
sh 'make -f opencga-app/app/cloud/docker/Makefile DOCKER_ORG="opencb"'
}
}
stage ('Publish OpenCGA-Hadoop Docker Images') {
options {
timeout(time: 25, unit: 'MINUTES')
}
steps {
script {
def images = ["opencga", "opencga-app", "opencga-daemon", "opencga-init", "opencga-batch"]
def tag = sh(returnStdout: true, script: "git log -1 --pretty=%h").trim()
withDockerRegistry([ credentialsId: "wasim-docker-hub", url: "" ]) {
for(int i =0; i < images.size(); i++){
sh "docker tag '${images[i]}' opencb/'${images[i]}':${tag}"
sh "docker push opencb/'${images[i]}':${tag}"
}
}
}
}
}
stage ('Build With Mongo Profile') {
options {
timeout(time: 30, unit: 'MINUTES')
}
steps {
sh 'mvn clean install -DskipTests -Dopencga.war.name=opencga -Dcheckstyle.skip'
}
}
stage ('Build OpenCGA-Mongo Docker Images') {
options {
timeout(time: 25, unit: 'MINUTES')
}
steps {
sh 'docker build -t opencga-next -f opencga-app/app/cloud/docker/opencga-next/Dockerfile .'
sh 'docker build -t opencga-demo -f opencga-app/app/cloud/docker/opencga-demo/Dockerfile .'
}
}
stage ('Publish OpenCGA-Mongo Docker Images') {
options {
timeout(time: 25, unit: 'MINUTES')
}
steps {
script {
def images = ["opencga-next", "opencga-demo"]
def tag = sh(returnStdout: true, script: "git tag --sort version:refname | tail -1").trim().substring(1)
withDockerRegistry([ credentialsId: "wasim-docker-hub", url: "" ]) {
for(int i =0; i < images.size(); i++){
sh "docker tag '${images[i]}' opencb/'${images[i]}':${tag}"
sh "docker push opencb/'${images[i]}':${tag}"
}
}
}
}
}
stage ('Clean Docker Images') {
options {
timeout(time: 10, unit: 'MINUTES')
}
steps {
sh 'docker system prune --force -a'
}
}
stage ('Quick Test') {
options {
timeout(time: 1, unit: 'HOURS')
}
when {
allOf {
changeset '**/*.java'
not {
changeset 'opencga-storage/**/*.java'
}
}
}
steps {
sh 'mvn -Dmaven.test.failure.ignore=true test -pl \'!:opencga-storage-mongodb,!:opencga-storage-hadoop,!:opencga-storage-hadoop-core\''
}
post {
success {
junit '**/target/surefire-reports/**/*.xml'
}
}
}
stage ('Complete Test') {
options {
timeout(time: 4, unit: 'HOURS')
}
when {
changeset 'opencga-storage/**/*.java'
}
steps {
sh 'mvn -Dmaven.test.failure.ignore=true test'
}
post {
success {
junit '**/target/surefire-reports/**/*.xml'
}
}
}
}
}