From 5c567d2707241dd967a7622e733b874874a321ef Mon Sep 17 00:00:00 2001 From: Francia Csaba Date: Wed, 20 Dec 2023 12:04:56 +0100 Subject: [PATCH] Wrapped docker commands in script blocks --- Jenkinsfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5fd62c2..d2cd8ce 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,14 +49,18 @@ pipeline { stage('Build docker image') { steps { echo 'Building image' - docker.build("${OWNER}/${IMAGE_NAME}:${TAG}") + script{ + docker.build("${OWNER}/${IMAGE_NAME}:${TAG}") + } } } stage('Push image to container registry') { steps { echo 'Pushing image to registry' - docker.withRegistry(REGISTRY_URL, GITEA_CREDS){ - docker.image("${OWNER}/${IMAGE_NAME}:${TAG}").push() + script{ + docker.withRegistry(REGISTRY_URL, GITEA_CREDS){ + docker.image("${OWNER}/${IMAGE_NAME}:${TAG}").push() + } } } }