Update Jenkinsfile

This commit is contained in:
senatorovv 2023-07-12 11:54:47 +04:00 committed by GitHub
parent 2e423e2ab0
commit 754799a259
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

22
Jenkinsfile vendored
View file

@ -1,12 +1,28 @@
#!groovy
pipeline {
agent none
stages {
agent none stages {
stage('Maven Install') {
agent any
agent any
steps {
sh 'mvn clean install'
}
}
stage('Docker Build') {
agent any
steps {
sh 'docker build -t registry.hub.docker.com/hybrid2k3/petclinic:1 .'
}
}
stage('Docker Push') {
agent any
steps {
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) {
sh "docker login -u ${env.dockerHubUser} -p ${env.dockerHubPassword}"
sh 'registry.hub.docker.com/hybrid2k3/petclinic:1'
}
}
}
}
}