mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 22:35:50 +00:00
build fixed, deploy job done
This commit is contained in:
parent
99c2d18bc3
commit
de98afcd93
2 changed files with 26 additions and 5 deletions
|
@ -1,11 +1,11 @@
|
|||
pipeline {
|
||||
agent any
|
||||
// triggers {
|
||||
// pollSCM('H/5 * * * *') // Watches the `dev` branch
|
||||
// }
|
||||
triggers {
|
||||
pollSCM('H/5 * * * *') // Watches the `dev` branch
|
||||
}
|
||||
environment {
|
||||
DOCKERHUB_CREDENTIALS = credentials('nalexxgd_docker_pass')
|
||||
DOCKERHUB_USERNAME = "nalexxgd"
|
||||
DOCKERHUB_CREDENTIALS = credentials('nalexx6_docker_pass')
|
||||
DOCKERHUB_USERNAME = "nalexx6"
|
||||
NEXUS_URL = 'localhost:8081'
|
||||
def ARTIFACT_VERSION = sh(script: "mvn help:evaluate -Dexpression=project.version -q -DforceStdout", returnStdout: true).trim()
|
||||
|
||||
|
|
21
cicd/jenkins-pipelines/deploy.groovy
Normal file
21
cicd/jenkins-pipelines/deploy.groovy
Normal file
|
@ -0,0 +1,21 @@
|
|||
pipeline {
|
||||
agent any
|
||||
parameters {
|
||||
string(name: 'ARTIFACT_VERSION', description: 'Version of the artifact to deploy')
|
||||
}
|
||||
environment {
|
||||
DOCKERHUB_USERNAME = "nalexx6"
|
||||
}
|
||||
stages {
|
||||
stage('Pull Docker Image') {
|
||||
steps {
|
||||
sh "docker pull ${DOCKERHUB_USERNAME}/petclinic:${ARTIFACT_VERSION}"
|
||||
}
|
||||
}
|
||||
stage('Run Docker Container') {
|
||||
steps {
|
||||
sh "docker run -d -p 80:8080 ${DOCKERHUB_USERNAME}/petclinic:${ARTIFACT_VERSION}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue