forked from firstBitMarksistskaya/onec-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-edt-swarm-agent.bat
42 lines (29 loc) · 1.03 KB
/
build-edt-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
40
41
42
@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=".")
set edt_version=%EDT_VERSION%
set edt_escaped=%edt_version: =_%
docker build ^
--pull ^
--build-arg ONEC_USERNAME=%ONEC_USERNAME% ^
--build-arg ONEC_PASSWORD=%ONEC_PASSWORD% ^
--build-arg EDT_VERSION=%EDT_VERSION% ^
-t %DOCKER_REGISTRY_URL%/onec-client:%edt_escaped% ^
-f edt/Dockerfile ^
%last_arg%
if %ERRORLEVEL% neq 0 goto end
docker build ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
--build-arg BASE_IMAGE=edt ^
--build-arg BASE_TAG=%edt_escaped% ^
-t %DOCKER_REGISTRY_URL%/base-jenkins-agent:%edt_escaped% ^
-f swarm-jenkins-agent/Dockerfile ^
%last_arg%
if %ERRORLEVEL% neq 0 goto end
docker push %DOCKER_REGISTRY_URL%/base-jenkins-agent:%edt_escaped%
if %ERRORLEVEL% neq 0 goto end
:end
echo End of program.