gyjhrfdt
This commit is contained in:
@@ -25,16 +25,18 @@ pipeline {
|
|||||||
script {
|
script {
|
||||||
def version = "0.0.${env.BUILD_NUMBER}"
|
def version = "0.0.${env.BUILD_NUMBER}"
|
||||||
def imageName = "clean-architecture-backend:${version}"
|
def imageName = "clean-architecture-backend:${version}"
|
||||||
|
|
||||||
withCredentials([string(credentialsId: 'docker-registry-url', variable: 'REGISTRY_URL')]) {
|
withCredentials([string(credentialsId: 'docker-registry-url', variable: 'REGISTRY_URL')]) {
|
||||||
def fullImageName = "${REGISTRY_URL}/${imageName}"
|
// Nota: Aqu<71> no es necesaria la interpolaci<63>n directa de REGISTRY_URL
|
||||||
echo "FULL IMAGE NAME || FULL IMAGE NAME || FULL IMAGE NAME || FULL IMAGE NAME || FULL IMAGE NAME || FULL IMAGE NAME "
|
def fullImageName = "${env.REGISTRY_URL}/${imageName}"
|
||||||
echo "Full Image Name: ${fullImageName}"
|
echo "Full Image Name: ${fullImageName}"
|
||||||
|
|
||||||
// Construir la imagen
|
// Construir la imagen
|
||||||
sh "docker build --build-arg ENVIRONMENT=${ASP_ENVIRONMENT} -t ${imageName} ./CleanArchitecture/"
|
sh "docker build --build-arg ENVIRONMENT=${env.ASP_ENVIRONMENT} -t ${imageName} ./CleanArchitecture/"
|
||||||
|
|
||||||
//// Login y Push usando withDockerRegistry
|
// Login y Push usando withDockerRegistry
|
||||||
docker.withRegistry("${REGISTRY_URL}", 'dockerregistryalexdev') {
|
docker.withRegistry("${env.REGISTRY_URL}", 'dockerregistryalexdev') {
|
||||||
|
// Aseg<65>rate de que el tag y push se realizan correctamente
|
||||||
sh "docker tag ${imageName} ${fullImageName}"
|
sh "docker tag ${imageName} ${fullImageName}"
|
||||||
sh "docker push ${fullImageName}"
|
sh "docker push ${fullImageName}"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user