mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-29 18:55:49 +00:00
JenkinsFile docker configuration
This commit is contained in:
parent
01236fbb48
commit
c7023de05c
1 changed files with 20 additions and 19 deletions
39
Jenkinsfile
vendored
39
Jenkinsfile
vendored
|
@ -1,4 +1,11 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
|
|
||||||
|
environment {
|
||||||
|
registry = "rolandgryddynamics/mr"
|
||||||
|
registryCredential = 'dockerhub_id'
|
||||||
|
dockerImage = ''
|
||||||
|
}
|
||||||
|
|
||||||
agent {
|
agent {
|
||||||
node {
|
node {
|
||||||
label 'ubuntu-master'
|
label 'ubuntu-master'
|
||||||
|
@ -22,27 +29,21 @@ pipeline {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
stage('docker') {
|
stage('Building docker image') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
sh 'docker version'
|
dockerImage = docker.build registry + ":$BUILD_NUMBER"
|
||||||
app = docker.build("rolandgryddynamics/mr")
|
|
||||||
// sh 'docker build -t my/app .'
|
|
||||||
|
|
||||||
// sh 'docker tag my/app rolandgryddynamics/mr'
|
|
||||||
// sh 'docker tag push rolandgryddynamics/mr'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('deploy to dockerhub') {
|
stage('Deploy our image') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
echo 'jelllkdskdks'
|
docker.withRegistry( '', registryCredential ) {
|
||||||
docker.withRegistry("https://registry.hub.docker.com", "webserver_login")
|
dockerImage.push()
|
||||||
app.push("${env.BUILD_NUMBER}")
|
}
|
||||||
app.push("latest")
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue