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
25
Jenkinsfile
vendored
25
Jenkinsfile
vendored
|
@ -1,4 +1,11 @@
|
|||
pipeline {
|
||||
|
||||
environment {
|
||||
registry = "rolandgryddynamics/mr"
|
||||
registryCredential = 'dockerhub_id'
|
||||
dockerImage = ''
|
||||
}
|
||||
|
||||
agent {
|
||||
node {
|
||||
label 'ubuntu-master'
|
||||
|
@ -22,25 +29,19 @@ pipeline {
|
|||
// }
|
||||
// }
|
||||
|
||||
stage('docker') {
|
||||
stage('Building docker image') {
|
||||
steps {
|
||||
script {
|
||||
sh 'docker version'
|
||||
app = docker.build("rolandgryddynamics/mr")
|
||||
// sh 'docker build -t my/app .'
|
||||
|
||||
// sh 'docker tag my/app rolandgryddynamics/mr'
|
||||
// sh 'docker tag push rolandgryddynamics/mr'
|
||||
dockerImage = docker.build registry + ":$BUILD_NUMBER"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('deploy to dockerhub') {
|
||||
stage('Deploy our image') {
|
||||
steps {
|
||||
script {
|
||||
echo 'jelllkdskdks'
|
||||
docker.withRegistry("https://registry.hub.docker.com", "webserver_login")
|
||||
app.push("${env.BUILD_NUMBER}")
|
||||
app.push("latest")
|
||||
docker.withRegistry( '', registryCredential ) {
|
||||
dockerImage.push()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue