Skip to content

Commit 4057769

Browse files
committedAug 12, 2020
jenkins: Use docker-build.py in jenkinsfile
1 parent 28eb0aa commit 4057769

File tree

1 file changed

+31
-58
lines changed

1 file changed

+31
-58
lines changed
 

‎Jenkinsfile

+31-58
Original file line numberDiff line numberDiff line change
@@ -29,105 +29,78 @@ pipeline {
2929
}
3030
}
3131

32-
stage ('Build With Hadoop Profile against hdp2.5') {
32+
stage ('Build With MongoDB storage-engine') {
3333
options {
3434
timeout(time: 30, unit: 'MINUTES')
3535
}
3636
steps {
37-
sh 'mvn clean install -DskipTests -Phdp2.5 -Dcheckstyle.skip'
37+
sh 'mvn clean install -DskipTests -Dopencga.war.name=opencga -Dcheckstyle.skip'
3838
}
3939
}
4040

41-
stage ('Build With Hadoop Profile against hdp3.1') {
41+
stage ('Build and publish OpenCGA Docker Images') {
4242
options {
4343
timeout(time: 30, unit: 'MINUTES')
4444
}
4545
steps {
46-
sh 'mvn clean install -DskipTests -Phdp3.1 -Dcheckstyle.skip'
46+
withDockerRegistry([ credentialsId: "wasim-docker-hub", url: "" ]) {
47+
sh "build/cloud/docker/docker-build.py --org opencb push"
48+
}
4749
}
4850
}
49-
stage ('Build With Hadoop Profile against hdp2.6') {
51+
52+
stage ('Build With Hadoop storage-engine against hdp2.5') {
5053
options {
5154
timeout(time: 30, unit: 'MINUTES')
5255
}
5356
steps {
54-
sh 'mvn clean install -DskipTests -Dstorage-mongodb -Dstorage-hadoop -Phdp2.6 -DOPENCGA.STORAGE.DEFAULT_ENGINE=hadoop -Dopencga.war.name=opencga -Dcheckstyle.skip'
57+
sh 'mvn clean install -DskipTests -P storage-hadoop -Phdp2.5 -Dcheckstyle.skip -Dopencga.war.name=opencga'
5558
}
5659
}
57-
58-
stage ('Validate') {
60+
stage ('Build With Hadoop storage-engine against hdp3.1') {
5961
options {
60-
timeout(time: 5, unit: 'MINUTES')
62+
timeout(time: 30, unit: 'MINUTES')
6163
}
6264
steps {
63-
sh 'mvn validate'
65+
sh 'mvn clean install -DskipTests -P storage-hadoop -Phdp3.1 -Dcheckstyle.skip -Dopencga.war.name=opencga'
6466
}
6567
}
66-
67-
stage ('Build OpenCGA-Hadoop Docker Images') {
68+
stage ('Build and publish OpenCGA Docker Images hdp3.1') {
6869
options {
69-
timeout(time: 25, unit: 'MINUTES')
70+
timeout(time: 30, unit: 'MINUTES')
7071
}
7172
steps {
72-
sh 'make -f opencga-app/app/cloud/docker/Makefile DOCKER_ORG="opencb"'
73-
}
74-
}
75-
76-
stage ('Publish OpenCGA-Hadoop Docker Images') {
77-
options {
78-
timeout(time: 25, unit: 'MINUTES')
79-
}
80-
steps {
81-
script {
82-
def images = ["opencga", "opencga-app", "opencga-daemon", "opencga-init", "opencga-batch"]
83-
def tag = sh(returnStdout: true, script: "git log -1 --pretty=%h").trim()
84-
withDockerRegistry([ credentialsId: "wasim-docker-hub", url: "" ]) {
85-
for(int i =0; i < images.size(); i++){
86-
sh "docker tag '${images[i]}' opencb/'${images[i]}':${tag}"
87-
sh "docker push opencb/'${images[i]}':${tag}"
88-
}
89-
}
73+
withDockerRegistry([ credentialsId: "wasim-docker-hub", url: "" ]) {
74+
sh "build/cloud/docker/docker-build.py --org opencb --images base,init push"
9075
}
91-
}
76+
}
9277
}
93-
94-
stage ('Build With Mongo Profile') {
78+
stage ('Build With Hadoop storage-engine against hdp2.6') {
9579
options {
9680
timeout(time: 30, unit: 'MINUTES')
9781
}
9882
steps {
99-
sh 'mvn clean install -DskipTests -Dopencga.war.name=opencga -Dcheckstyle.skip'
83+
sh 'mvn clean install -DskipTests -Dstorage-mongodb -Dstorage-hadoop -Phdp2.6 -DOPENCGA.STORAGE.DEFAULT_ENGINE=hadoop -Dopencga.war.name=opencga -Dcheckstyle.skip'
10084
}
10185
}
102-
103-
stage ('Build OpenCGA-Mongo Docker Images') {
86+
stage ('Build and publish OpenCGA Docker Images hdp2.6') {
10487
options {
105-
timeout(time: 25, unit: 'MINUTES')
88+
timeout(time: 30, unit: 'MINUTES')
10689
}
10790
steps {
108-
sh 'docker build -t opencga-next -f opencga-app/app/cloud/docker/opencga-next/Dockerfile .'
109-
sh 'docker build -t opencga-demo -f opencga-app/app/cloud/docker/opencga-demo/Dockerfile .'
91+
withDockerRegistry([ credentialsId: "wasim-docker-hub", url: "" ]) {
92+
sh "build/cloud/docker/docker-build.py --org opencb --images base,init push"
93+
}
11094
}
11195
}
112-
113-
stage ('Publish OpenCGA-Mongo Docker Images') {
114-
options {
115-
timeout(time: 25, unit: 'MINUTES')
116-
}
117-
steps {
118-
script {
119-
def images = ["opencga-next", "opencga-demo"]
120-
def tag = sh(returnStdout: true, script: "git tag --sort version:refname | tail -1").trim().substring(1)
121-
withDockerRegistry([ credentialsId: "wasim-docker-hub", url: "" ]) {
122-
for(int i =0; i < images.size(); i++){
123-
sh "docker tag '${images[i]}' opencb/'${images[i]}':${tag}"
124-
sh "docker push opencb/'${images[i]}':${tag}"
125-
}
126-
}
127-
}
128-
}
96+
stage ('Validate') {
97+
options {
98+
timeout(time: 5, unit: 'MINUTES')
99+
}
100+
steps {
101+
sh 'mvn validate'
102+
}
129103
}
130-
131104
stage ('Clean Docker Images') {
132105
options {
133106
timeout(time: 10, unit: 'MINUTES')

0 commit comments

Comments
 (0)
Please sign in to comment.