diff --git a/Jenkinsfile b/Jenkinsfile index bc84972..7a70eb0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -70,10 +70,14 @@ pipeline { def gitCommit = env.GIT_COMMIT ?: 'unknown' bat """ docker login ${env.ACR_REGISTRY} -u ${env.ACR_USERNAME} -p %ACR_PASS% + if %errorlevel% neq 0 exit /b 1 docker pull --platform=linux/amd64 ${fullImage} || echo Pull failed, will build fresh - docker build --platform=linux/amd64 -f ${env.DOCKERFILE} ${env.BUILD_ARGS} --build-arg GIT_COMMIT=${gitCommit} ${cacheArgs} -t ${fullImage} . || exit /b %ERRORLEVEL% - docker push ${fullImage} || exit /b %ERRORLEVEL% - docker rmi ${fullImage} || exit 0 + docker build --platform=linux/amd64 -f ${env.DOCKERFILE} ${env.BUILD_ARGS} --build-arg GIT_COMMIT=${gitCommit} ${cacheArgs} -t ${fullImage} . + if %errorlevel% neq 0 exit /b 1 + docker push ${fullImage} + if %errorlevel% neq 0 exit /b 1 + docker rmi ${fullImage} + exit /b 0 """ } }