Commit c1e0d153 authored by Unai Perez's avatar Unai Perez
Browse files

Modified Jenkinsfile. This time it will work

parent 2aab30cb
pipeline {
agent {
dockerfile {
filename "Dockerfile"
additionalBuildArgs "-t bsc-ppc/compss-docker-test:${env.BUILD_NUMBER}"
args "--privileged -e DOCKER_HOST=unix:///var/run/docker.sock -u root:root" +
" -v /home/`whoami`/.m2/repository:/root/.m2 -v ${env.WORKSPACE}/junit:/root/junit"
}
}
agent any
stages {
stage("Environment setup") {
steps {
script {
// sh "nohup lxd &"
sh "nohup dockerd &"
}
}
}
stage("Compiling") {
steps {
script {
sh "/root/framework/builders/buildlocal -M -B -P -T -A -K -X -d /opt/COMPSs"
}
}
}
stage("Building app and its images") {
steps {
script {
sh "mvn -f /root/framework/tests/containers/pom.xml -DskipTests " +
"clean package exec:exec@genimage-docker"
}
}
}
stage("Testing") {
steps {
script {
sh "cd /root/framework/tests/containers && mvn test"
sh "mvn clean install -DskipTests"
}
}
}
}
post {
failure {
updateGitlabCommitStatus name: 'Compiling', state: 'failed'
emailext attachLog: true,
mimeType: 'text/html',
body: "<b>An error has ocurred</b><br>Project: ${env.JOB_NAME} #${env.BUILD_NUMBER} <br/>" +
"URL: <a href='${env.BUILD_URL}'>${env.BUILD_URL}</a>",
subject: "ERROR ON ${env.JOB_NAME} #${env.BUILD_NUMBER}",
to: 'unai.perez@bsc.es'
}
success {
sh "cp /root/framework/tests/containers/target/surefire-reports/*.xml /root/junit/"
junit "${env.WORKSPACE}/junit"
//sh "cp /root/framework/tests/containers/target/surefire-reports/*.xml /root/junit/"
//junit "${env.WORKSPACE}/junit"
updateGitlabCommitStatus name: 'Compiling', state: 'success'
}
always{
node("master") {
deleteDir()
sh "docker rmi bsc-ppc/compss-docker-test:${env.BUILD_NUMBER} -f"
}
}
}
options {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment