mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 06:45:49 +00:00
Se modifico JenkinsFile
This commit is contained in:
parent
b5254957ff
commit
15c088790c
1 changed files with 6 additions and 6 deletions
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
|
@ -4,30 +4,29 @@ pipeline {
|
||||||
stages {
|
stages {
|
||||||
stage ('Initialize') {
|
stage ('Initialize') {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
echo 'Docker login..'
|
||||||
echo "PATH = ${PATH}"
|
sh 'docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"'
|
||||||
echo "M2_HOME = ${M2_HOME}"
|
|
||||||
'''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
echo 'Building..'
|
echo 'Building..'
|
||||||
sh 'docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"'
|
|
||||||
sh 'mvn -q package'
|
sh 'mvn -q package'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Sonar') {
|
stage('Sonar') {
|
||||||
steps {
|
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'
|
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') {
|
stage('Build Container') {
|
||||||
steps {
|
steps {
|
||||||
echo 'Building..'
|
echo 'Building Docker Image..'
|
||||||
sh 'docker rmi --force "natyramone/pet-clinic"'
|
sh 'docker rmi --force "natyramone/pet-clinic"'
|
||||||
sh 'docker build -t pet-clinic .'
|
sh 'docker build -t pet-clinic .'
|
||||||
sh 'docker tag pet-clinic $DOCKER_USER/pet-clinic:latest'
|
sh 'docker tag pet-clinic $DOCKER_USER/pet-clinic:latest'
|
||||||
|
@ -38,6 +37,7 @@ pipeline {
|
||||||
stage('Run local container') {
|
stage('Run local container') {
|
||||||
agent any
|
agent any
|
||||||
steps {
|
steps {
|
||||||
|
|
||||||
sh 'docker rm -f pet-clinic || true'
|
sh 'docker rm -f pet-clinic || true'
|
||||||
sh 'docker run -d -p 8081:8080 --name pet-clinic natyramone/pet-clinic:latest'
|
sh 'docker run -d -p 8081:8080 --name pet-clinic natyramone/pet-clinic:latest'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue