forked from firstBitMarksistskaya/onec-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-oscript-swarm-agent.bat
39 lines (27 loc) · 1013 Bytes
/
build-oscript-swarm-agent.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@echo off
docker login -u %DOCKER_LOGIN% -p %DOCKER_PASSWORD% %DOCKER_REGISTRY_URL%
if %ERRORLEVEL% neq 0 goto end
if %DOCKER_SYSTEM_PRUNE%=="true" docker system prune -af
if %ERRORLEVEL% neq 0 goto end
if %NO_CACHE%=="true" (SET last_arg="--no-cache .") else (SET last_arg=".")
docker build ^
--pull ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
--build-arg BASE_IMAGE=onec-client-vnc ^
--build-arg BASE_TAG=%ONEC_VERSION% ^
-t %DOCKER_REGISTRY_URL%/onec-client-vnc-oscript:%ONEC_VERSION% ^
-f oscript/Dockerfile ^
%last_arg%
if %ERRORLEVEL% neq 0 goto end
docker build ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
--build-arg BASE_IMAGE=oscript-jdk ^
--build-arg BASE_TAG=latest ^
-t %DOCKER_REGISTRY_URL%/base-jenkins-agent:latest ^
-f swarm-jenkins-agent/Dockerfile ^
%last_arg%
if %ERRORLEVEL% neq 0 goto end
docker push %DOCKER_REGISTRY_URL%/base-jenkins-agent:latest
if %ERRORLEVEL% neq 0 goto end
:end
echo End of program.