mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 15:25:49 +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 {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
// triggers {
|
triggers {
|
||||||
// pollSCM('H/5 * * * *') // Watches the `dev` branch
|
pollSCM('H/5 * * * *') // Watches the `dev` branch
|
||||||
// }
|
}
|
||||||
environment {
|
environment {
|
||||||
DOCKERHUB_CREDENTIALS = credentials('nalexxgd_docker_pass')
|
DOCKERHUB_CREDENTIALS = credentials('nalexx6_docker_pass')
|
||||||
DOCKERHUB_USERNAME = "nalexxgd"
|
DOCKERHUB_USERNAME = "nalexx6"
|
||||||
NEXUS_URL = 'localhost:8081'
|
NEXUS_URL = 'localhost:8081'
|
||||||
def ARTIFACT_VERSION = sh(script: "mvn help:evaluate -Dexpression=project.version -q -DforceStdout", returnStdout: true).trim()
|
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