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'
|
||||
}
|
||||
stages {
|
||||
stage('Checkstyle') {
|
||||
steps {
|
||||
sh './mvnw checkstyle:checkstyle'
|
||||
archiveArtifacts artifacts: 'target/checkstyle-result.xml', fingerprint: true
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
steps {
|
||||
sh './mvnw test'
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh './mvnw clean package -DskipTests'
|
||||
}
|
||||
}
|
||||
// stage('Checkstyle') {
|
||||
// steps {
|
||||
// sh './mvnw checkstyle:checkstyle'
|
||||
// archiveArtifacts artifacts: 'target/checkstyle-result.xml', fingerprint: true
|
||||
// }
|
||||
// }
|
||||
// stage('Test') {
|
||||
// steps {
|
||||
// sh './mvnw test'
|
||||
// }
|
||||
// }
|
||||
// stage('Build') {
|
||||
// steps {
|
||||
// sh './mvnw clean package -DskipTests'
|
||||
// }
|
||||
// }
|
||||
stage('Create Docker Image') {
|
||||
steps {
|
||||
script {
|
||||
withCredentials([usernamePassword(credentialsId: "${DOCKER_CREDENTIALS_ID}", usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD')]) {
|
||||
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 push marijastopa/mr-jenkins:\${GIT_COMMIT:0:7}
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue