Skip to content
Snippets Groups Projects
Commit cc64e482 authored by Mattia Mancini's avatar Mattia Mancini
Browse files

SSB-47: refactored jenkinsfile to have a successful build

parent e2da98be
Branches
Tags
1 merge request!44Merge back holography to master
......@@ -4,35 +4,40 @@ pipeline {
}
environment {
LOFAR_REGISTRY_URL = "http://nexus.cep4.control.lofar:18080"
LOFAR_TAG = "${env.BUILD_NAME}-${env.BUILD_NUMBER}"
LOFAR_REGISTRY = "nexus.cep4.control.lofar:18080"
LOFAR_TAG = "${env.BRANCH_NAME}-${env.BUILD_NUMBER}"
}
stages {
stage('Build base docker file') {
steps {
script{
with dir('CAL/Docker/HolographyBase'){
def image = docker.build('holography-base')
image.tag(env.LOFAR_TAG)
dir('CAL/Docker/HolographyBase'){
name = docker.build("holography-base").tag(env.LOFAR_TAG)
withDockerRegistry(credentialsId: 'nexus', url: env.LOFAR_REGISTRY_URL) {
image.push()
tag_and_push(name, env.LOFAR_REGISTRY)
}
}
}
}
}
stage('Build build docker file') {
steps {
script{
with dir('CAL/Docker/HolographyBuild'){
def image = docker.build('holography-build')
image.tag(env.LOFAR_TAG)
name = docker.build("holography-build", '-f CAL/Docker/HolographyBuild/Dockerfile .')
.tag(env.LOFAR_TAG)
withDockerRegistry(credentialsId: 'nexus', url: env.LOFAR_REGISTRY_URL) {
image.push()
}
tag_and_push(name, env.LOFAR_REGISTRY)
}
}
}
}
}
}
def tag_and_push(image_name, registry){
sh "docker tag $image_name $registry/$image_name"
sh "docker push $registry/$image_name"
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment