pl-1/Jenkinsfile

31 lines
754 B
Text
Raw Normal View History

2025-10-06 11:40:37 -03:00
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()
}
}
}
}
}
}