From 935ce0c7aaf1029b5240370ec127b11aad24b047 Mon Sep 17 00:00:00 2001 From: TomPGrid Date: Fri, 28 Feb 2025 13:18:36 +0100 Subject: [PATCH] changed how push is invoked --- Jenkinsfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3a5879c9b..1e6a8a5b2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,11 +39,12 @@ pipeline { } steps { checkout scm - - def docker_image=docker.build("mr:8084/spring-petclinic:$GIT_COMMIT") - sh 'docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS" mr:8084' - docker.withRegistry('mr:8084') { - docker_image.push() + script { + def docker_image=docker.build("mr:8084/spring-petclinic:$GIT_COMMIT") + sh 'docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS" mr:8084' + docker.withRegistry('mr:8084') { + docker_image.push() + } } } }