forked from jugatsu/onec-docker
-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathbuild-base-swarm-jenkins-agent.bat
104 lines (79 loc) · 2.91 KB
/
build-base-swarm-jenkins-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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
@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=library ^
--build-arg BASE_IMAGE=ubuntu ^
--build-arg BASE_TAG=20.04 ^
--build-arg ONESCRIPT_PACKAGES="yard" ^
-t %DOCKER_REGISTRY_URL%/oscript-downloader:latest ^
-f oscript/Dockerfile ^
%last_arg%
docker build ^
--pull ^
--build-arg ONEC_USERNAME=%ONEC_USERNAME% ^
--build-arg ONEC_PASSWORD=%ONEC_PASSWORD% ^
--build-arg ONEC_VERSION=%ONEC_VERSION% ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
--build-arg BASE_IMAGE=oscript-downloader ^
--build-arg BASE_TAG=latest ^
-t %DOCKER_REGISTRY_URL%/onec-client:%ONEC_VERSION% ^
-f client/Dockerfile ^
%last_arg%
if %ERRORLEVEL% neq 0 goto end
docker push %DOCKER_REGISTRY_URL%/onec-client:%ONEC_VERSION%
if %ERRORLEVEL% neq 0 goto end
docker build ^
--pull ^
--build-arg ONEC_USERNAME=%ONEC_USERNAME% ^
--build-arg ONEC_PASSWORD=%ONEC_PASSWORD% ^
--build-arg ONEC_VERSION=%ONEC_VERSION% ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
-t %DOCKER_REGISTRY_URL%/onec-client-vnc:%ONEC_VERSION% ^
-f client-vnc/Dockerfile ^
%last_arg%
if %ERRORLEVEL% neq 0 goto end
docker push %DOCKER_REGISTRY_URL%/onec-client-vnc:%ONEC_VERSION%
if %ERRORLEVEL% neq 0 goto end
docker build ^
--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=onec-client-vnc-oscript ^
--build-arg BASE_TAG=%ONEC_VERSION% ^
-t %DOCKER_REGISTRY_URL%/onec-client-vnc-oscript-jdk:%ONEC_VERSION% ^
-f jdk/Dockerfile ^
%last_arg%
if %ERRORLEVEL% neq 0 goto end
docker build ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
--build-arg BASE_IMAGE=onec-client-vnc-oscript-jdk ^
--build-arg BASE_TAG=%ONEC_VERSION% ^
-t %DOCKER_REGISTRY_URL%/onec-client-vnc-oscript-jdk-testutils:%ONEC_VERSION% ^
-f test-utils/Dockerfile ^
%last_arg%
if %ERRORLEVEL% neq 0 goto end
docker build ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
--build-arg BASE_IMAGE=onec-client-vnc-oscript-jdk-testutils ^
--build-arg BASE_TAG=%ONEC_VERSION% ^
-t %DOCKER_REGISTRY_URL%/base-jenkins-agent:%ONEC_VERSION% ^
-f swarm-jenkins-agent/Dockerfile ^
%last_arg%
if %ERRORLEVEL% neq 0 goto end
IF NOT "%PUSH_AGENT%"=="false" (
docker push %DOCKER_REGISTRY_URL%/base-jenkins-agent:%ONEC_VERSION%
)
if %ERRORLEVEL% neq 0 goto end
:end
echo End of program.