Se modifico JenkinsFile

This commit is contained in:
geraving@gmail.com 2018-12-19 21:35:20 -03:00
parent b5254957ff
commit 15c088790c

12
Jenkinsfile vendored
View file

@ -4,30 +4,29 @@ pipeline {
stages {
stage ('Initialize') {
steps {
sh '''
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
'''
echo 'Docker login..'
sh 'docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"'
}
}
stage('Build') {
steps {
echo 'Building..'
sh 'docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"'
sh 'mvn -q package'
}
}
stage('Sonar') {
steps {
echo 'Running Sonar..'
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..'
echo 'Building Docker Image..'
sh 'docker rmi --force "natyramone/pet-clinic"'
sh 'docker build -t pet-clinic .'
sh 'docker tag pet-clinic $DOCKER_USER/pet-clinic:latest'
@ -38,6 +37,7 @@ pipeline {
stage('Run local container') {
agent any
steps {
sh 'docker rm -f pet-clinic || true'
sh 'docker run -d -p 8081:8080 --name pet-clinic natyramone/pet-clinic:latest'
}