forked from jugatsu/onec-docker
-
Notifications
You must be signed in to change notification settings - Fork 75
/
build-crs.bat
44 lines (30 loc) · 1.05 KB
/
build-crs.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
@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 ONEC_USERNAME=%ONEC_USERNAME% ^
--build-arg ONEC_PASSWORD=%ONEC_PASSWORD% ^
--build-arg ONEC_VERSION=%ONEC_VERSION% ^
-t %DOCKER_REGISTRY_URL%/crs:%ONEC_VERSION% ^
-f crs/Dockerfile ^
%last_arg%
if %ERRORLEVEL% neq 0 goto end
docker push %DOCKER_REGISTRY_URL%/crs:%ONEC_VERSION%
if %ERRORLEVEL% neq 0 goto end
docker build ^
--pull ^
--build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^
--build-arg ONEC_VERSION=%ONEC_VERSION% ^
-t %DOCKER_REGISTRY_URL%/crs-apache:%ONEC_VERSION% ^
-f crs-apache/Dockerfile ^
%last_arg%
if %ERRORLEVEL% neq 0 goto end
docker push %DOCKER_REGISTRY_URL%/crs-apache:%ONEC_VERSION%
if %ERRORLEVEL% neq 0 goto end
:end
echo End of program.