Fixing jenkisfile

This commit is contained in:
Natalia Villegas 2018-12-16 23:41:31 -03:00
parent 60cc11f9a2
commit 1e4ed072bc

19
Jenkinsfile vendored
View file

@ -24,16 +24,25 @@ pipeline {
stage('Sonar') {
steps {
sh 'mvn sonar:sonar -Dsonar.projectKey=villegasnaty_spring-petclinic -Dsonar.organization=villegasnaty-github -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=5f3fd10f7702318ee919ea4d55890502510b2448'
}
}
sh 'mvn sonar:sonar -Dsonar.projectKey=villegasnaty_spring-petclinic -Dsonar.organization=villegasnaty-github -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=5f3fd10f7702318ee919ea4d55890502510b2448'
}
}
stage('Build Container') {
steps {
echo 'Building..'
sh 'docker rmi --force "natyramone/pet-clinic"'
sh 'docker build -t pet-clinic .'
sh 'docker tag pet-clinic $DOCKER_USER/pet-clinic:latest'
}
}
stage('Run local container') {
agent any
steps {
sh 'docker rm -f natyramone/pet-clinic:latest || true'
sh 'docker run -d -p 8081:8080 natyramone/pet-clinic:latest'
sh 'docker rm -f pet-clinic || true'
sh 'docker run -d -p 8081:8080 --name pet-clinic natyramone/pet-clinic:latest'
}
}