Skip to content

Commit

Permalink
jenkins: Use docker-build.py in jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
j-coll committed Aug 12, 2020
1 parent 28eb0aa commit 4057769
Showing 1 changed file with 31 additions and 58 deletions.
89 changes: 31 additions & 58 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,105 +29,78 @@ pipeline {
}
}

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

stage ('Build With Hadoop Profile against hdp3.1') {
stage ('Build and publish OpenCGA Docker Images') {
options {
timeout(time: 30, unit: 'MINUTES')
}
steps {
sh 'mvn clean install -DskipTests -Phdp3.1 -Dcheckstyle.skip'
withDockerRegistry([ credentialsId: "wasim-docker-hub", url: "" ]) {
sh "build/cloud/docker/docker-build.py --org opencb push"
}
}
}
stage ('Build With Hadoop Profile against hdp2.6') {

stage ('Build With Hadoop storage-engine against hdp2.5') {
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'
sh 'mvn clean install -DskipTests -P storage-hadoop -Phdp2.5 -Dcheckstyle.skip -Dopencga.war.name=opencga'
}
}

stage ('Validate') {
stage ('Build With Hadoop storage-engine against hdp3.1') {
options {
timeout(time: 5, unit: 'MINUTES')
timeout(time: 30, unit: 'MINUTES')
}
steps {
sh 'mvn validate'
sh 'mvn clean install -DskipTests -P storage-hadoop -Phdp3.1 -Dcheckstyle.skip -Dopencga.war.name=opencga'
}
}

stage ('Build OpenCGA-Hadoop Docker Images') {
stage ('Build and publish OpenCGA Docker Images hdp3.1') {
options {
timeout(time: 25, unit: 'MINUTES')
timeout(time: 30, 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}"
}
}
withDockerRegistry([ credentialsId: "wasim-docker-hub", url: "" ]) {
sh "build/cloud/docker/docker-build.py --org opencb --images base,init push"
}
}
}
}

stage ('Build With Mongo Profile') {
stage ('Build With Hadoop storage-engine against hdp2.6') {
options {
timeout(time: 30, unit: 'MINUTES')
}
steps {
sh 'mvn clean install -DskipTests -Dopencga.war.name=opencga -Dcheckstyle.skip'
sh 'mvn clean install -DskipTests -Dstorage-mongodb -Dstorage-hadoop -Phdp2.6 -DOPENCGA.STORAGE.DEFAULT_ENGINE=hadoop -Dopencga.war.name=opencga -Dcheckstyle.skip'
}
}

stage ('Build OpenCGA-Mongo Docker Images') {
stage ('Build and publish OpenCGA Docker Images hdp2.6') {
options {
timeout(time: 25, unit: 'MINUTES')
timeout(time: 30, 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 .'
withDockerRegistry([ credentialsId: "wasim-docker-hub", url: "" ]) {
sh "build/cloud/docker/docker-build.py --org opencb --images base,init push"
}
}
}

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 ('Validate') {
options {
timeout(time: 5, unit: 'MINUTES')
}
steps {
sh 'mvn validate'
}
}

stage ('Clean Docker Images') {
options {
timeout(time: 10, unit: 'MINUTES')
Expand Down

0 comments on commit 4057769

Please sign in to comment.