This commit is contained in:
parent
ae9f93ee33
commit
6181a8f35e
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
@ -8,18 +8,22 @@ pipeline {
|
|||||||
agent any
|
agent any
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Building image') {
|
stage('Clone repository') {
|
||||||
steps{
|
/* Let's make sure we have the repository cloned to our workspace */
|
||||||
script {
|
checkout scm
|
||||||
dockerImage = docker.build registry + ":latest"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('Build image') {
|
||||||
|
/* This builds the actual image; synonymous to
|
||||||
|
* docker build on the command line */
|
||||||
|
app = docker.build("jcabillot/jenkins-wdocker")
|
||||||
|
}
|
||||||
|
|
||||||
stage('Deploy Image') {
|
stage('Deploy Image') {
|
||||||
steps{
|
steps{
|
||||||
script {
|
script {
|
||||||
docker.withRegistry('', registryCredential) {
|
docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
|
||||||
dockerImage.push()
|
app.push("latest")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user