Update Jenkinsfile

This commit is contained in:
senatorovv 2023-07-12 12:15:51 +04:00 committed by GitHub
parent f8558af303
commit 174d2a134a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

17
Jenkinsfile vendored
View file

@ -1,23 +1,18 @@
pipeline {
agent none stages {
stage('Maven Install') {
agent {
docker {
image 'maven:3.5.0'
}
}
steps {
sh 'mvn clean install'
agent any
stages {
stage('Maven Install') {
steps {
sh 'mvn clean install'
}
}
stage('Docker Build') {
agent any
steps {
sh 'docker build -t shanem/spring-petclinic:latest .'
}
}
stage('Docker Push') {
agent any
steps {
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) {
sh "docker login -u ${env.dockerHubUser} -p ${env.dockerHubPassword}"