diff --git a/Jenkinsfile b/Jenkinsfile index 86874c7..15413a2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,15 +106,14 @@ pipeline { bat """ docker login ${ACR_REGISTRY} -u ${ACR_USERNAME} -p %ACR_PASS% + if %errorlevel% neq 0 exit /b 1 docker pull --platform=linux/amd64 ${imageName} || echo Pull failed, will build fresh - docker build --platform=linux/amd64 \ - --build-arg SERVICE_MODULE=${svc} \ - --build-arg SERVICE_VERSION=${env.SERVICE_VERSION} \ - --build-arg BUILDKIT_INLINE_CACHE=1 \ - --cache-from ${imageName} \ - -t ${imageName} . + docker build --platform=linux/amd64 --build-arg SERVICE_MODULE=${svc} --build-arg SERVICE_VERSION=${env.SERVICE_VERSION} --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from ${imageName} -t ${imageName} . + if %errorlevel% neq 0 exit /b 1 docker push ${imageName} - docker rmi ${imageName} || exit 0 + if %errorlevel% neq 0 exit /b 1 + docker rmi ${imageName} + exit /b 0 """ } }