First commit
This commit is contained in:
commit
b84e7dcac2
3 changed files with 58 additions and 0 deletions
30
Jenkinsfile
vendored
Normal file
30
Jenkinsfile
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
IMAGE_NAME = 'test-img'
|
||||
DOCKERHUB_USER = 'ramonvasquezliesa'
|
||||
DOCKERHUB_REPO = "${DOCKERHUB_USER}/${IMAGE_NAME}"
|
||||
TAG = 'latest'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Build Image') {
|
||||
steps {
|
||||
script {
|
||||
docker.build("${DOCKERHUB_REPO}:${TAG}", '-f Dockerfile .')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Push Image') {
|
||||
steps {
|
||||
script {
|
||||
docker.withRegistry('https://index.docker.io/v1/', 'dockerhub-credentials') {
|
||||
docker.image("${DOCKERHUB_REPO}:${TAG}").push()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue