This commit is contained in:
Alejandro Sarmiento
2024-03-11 21:21:54 +01:00
parent 7473c4c8e4
commit 18795bfa1d

View File

@@ -30,13 +30,13 @@ pipeline {
// Usando withCredentials para manejar el REGISTRY_URL
withCredentials([string(credentialsId: 'docker-registry-url', variable: 'REGISTRY_URL')]) {
// Aqu<71> usamos env.REGISTRY_URL para asegurarnos de que estamos usando la variable de entorno correcta
def fullImageName = "${env.REGISTRY_URL}/${imageName}"
def fullImageName = "https://dockerregistry.alexdev.es/${imageName}"
// Construir la imagen
sh "docker build --build-arg ENVIRONMENT=${env.ASP_ENVIRONMENT} -t ${imageName} ./CleanArchitecture/"
// Iniciar sesi<73>n y subir la imagen
docker.withRegistry(env.REGISTRY_URL, 'dockerregistryalexdev') {
docker.withRegistry('https://dockerregistry.alexdev.es', 'dockerregistryalexdev') {
echo "Vamos a ejecutar el docker tag"
sh "docker tag ${imageName} ${fullImageName}"
echo "Vamos a ejecutar el docker push"