mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 23:05:49 +00:00
Update Jenkinsfile
This commit is contained in:
parent
ee41c939a9
commit
b8b8b71c5e
1 changed files with 17 additions and 17 deletions
34
Jenkinsfile
vendored
34
Jenkinsfile
vendored
|
@ -4,28 +4,28 @@ pipeline {
|
||||||
DOCKER_CREDENTIALS_ID = 'dockerhub-credentials'
|
DOCKER_CREDENTIALS_ID = 'dockerhub-credentials'
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Checkstyle') {
|
// stage('Checkstyle') {
|
||||||
steps {
|
// steps {
|
||||||
sh './mvnw checkstyle:checkstyle'
|
// sh './mvnw checkstyle:checkstyle'
|
||||||
archiveArtifacts artifacts: 'target/checkstyle-result.xml', fingerprint: true
|
// archiveArtifacts artifacts: 'target/checkstyle-result.xml', fingerprint: true
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
stage('Test') {
|
// stage('Test') {
|
||||||
steps {
|
// steps {
|
||||||
sh './mvnw test'
|
// sh './mvnw test'
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
stage('Build') {
|
// stage('Build') {
|
||||||
steps {
|
// steps {
|
||||||
sh './mvnw clean package -DskipTests'
|
// sh './mvnw clean package -DskipTests'
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
stage('Create Docker Image') {
|
stage('Create Docker Image') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
withCredentials([usernamePassword(credentialsId: "${DOCKER_CREDENTIALS_ID}", usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) {
|
withCredentials([usernamePassword(credentialsId: "${DOCKER_CREDENTIALS_ID}", usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) {
|
||||||
sh """
|
sh """
|
||||||
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
|
docker login -u \$DOCKER_USERNAME --password \$DOCKER_PASSWORD
|
||||||
docker build -t marijastopa/mr-jenkins:\${GIT_COMMIT:0:7} .
|
docker build -t marijastopa/mr-jenkins:\${GIT_COMMIT:0:7} .
|
||||||
docker push marijastopa/mr-jenkins:\${GIT_COMMIT:0:7}
|
docker push marijastopa/mr-jenkins:\${GIT_COMMIT:0:7}
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue