mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 14:05:50 +00:00
Update Jenkinsfile
This commit is contained in:
parent
ea358e14ba
commit
2808f362b6
1 changed files with 6 additions and 38 deletions
44
Jenkinsfile
vendored
44
Jenkinsfile
vendored
|
@ -1,39 +1,7 @@
|
||||||
#!groovy
|
library 'my-shared-library'
|
||||||
|
|
||||||
pipeline {
|
myDeliveryPipeline(branch: 'master', scmUrl: 'ssh://git@myScmServer.com/repos/myRepo.git',
|
||||||
agent none
|
email: 'mrcool435@gmail.com', serverPort: '8080',
|
||||||
stages {
|
developmentServer: 'dev-myproject.mycompany.com',
|
||||||
stage('Maven Install') {
|
stagingServer: 'staging-myproject.mycompany.com',
|
||||||
agent {
|
productionServer: 'production-myproject.mycompany.com')
|
||||||
docker {
|
|
||||||
image 'maven:3.5.4-jdk-8-alpine'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
sh 'mvn clean install -Dmaven.test.skip=true'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Run tests') {
|
|
||||||
agent any
|
|
||||||
steps {
|
|
||||||
sh 'mvn clean install -Dmaven.test.skip=true'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Docker Build') {
|
|
||||||
agent any
|
|
||||||
steps {
|
|
||||||
sh 'docker build -t sanjeev435/spring-petclinic:latest .'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Docker Push') {
|
|
||||||
agent any
|
|
||||||
steps {
|
|
||||||
withCredentials([usernamePassword(credentialsId: 'DOCKER_HUB_GLOBAL', passwordVariable: 'dockerHubPassword',
|
|
||||||
usernameVariable: 'dockerHubUser')]) {
|
|
||||||
sh "docker login -u ${env.dockerHubUser} -p ${env.dockerHubPassword}"
|
|
||||||
sh 'docker push sanjeev435/spring-petclinic'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue