argos/Jenkinsfile

66 lines
1.8 KiB
Plaintext
Raw Permalink Normal View History

2020-09-24 16:20:33 +02:00
def pipelineContext = [:]
pipeline {
agent any
options {
skipDefaultCheckout(true)
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build API') {
steps {
script {
pipelineContext.apiImage = docker.build("open-dmp-api:${env.BUILD_ID}", "-f dmp-backend/Dockerfile.CI dmp-backend/")
}
}
}
stage('Build WebApp') {
steps {
script {
pipelineContext.webappImage = docker.build("open-dmp-webapp:${env.BUILD_ID}", "-f dmp-frontend/Dockerfile.CI dmp-frontend/")
}
}
}
2020-09-24 16:37:32 +02:00
//stage('SonarQube analysis') {
// steps {
// script {
// def scannerHome = tool 'SonarQube Scanner 4.3';
// withSonarQubeEnv('SonarQube') { // If you have configured more than one global server connection, you can specify its name
// sh "${scannerHome}/bin/sonar-scanner"
// }
// }
// }
//}
//// waiting for sonar results based into the configured web hook in Sonar server which push the status back to jenkins
//stage('SonarQube scan result check') {
// steps {
// timeout(time: 2, unit: 'MINUTES') {
// retry(3) {
// script {
// def qg = waitForQualityGate()
// if (qg.status != 'OK') {
// error "Pipeline aborted due to quality gate failure: ${qg.status}"
// }
// }
// }
// }
// }
//}
2020-09-24 16:20:33 +02:00
stage('Pushing to Docker Registry') {
steps {
script {
2020-09-24 16:37:32 +02:00
docker.withRegistry('http://drepo.local.cite.gr', 'b2c651c1-9a3b-4a98-a6da-e1dd7a20f512') {
2020-09-24 16:20:33 +02:00
pipelineContext.apiImage.push()
pipelineContext.webappImage.push()
}
}
}
}
}
}