-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.bat
127 lines (121 loc) · 2.91 KB
/
run.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@ECHO OFF
SET COMPOSE_FILE_PATH=%CD%\target\classes\docker\docker-compose.yml
IF [%M2_HOME%]==[] (
SET MVN_EXEC=mvn
)
IF NOT [%M2_HOME%]==[] (
SET MVN_EXEC=%M2_HOME%\bin\mvn
)
IF [%1]==[] (
echo "Usage: %0 {build_start|build_start_it_supported|start|stop|purge|tail|reload_share|reload_acs|build_test|test}"
GOTO END
)
IF %1==build_start (
CALL :down
CALL :build
CALL :start
CALL :tail
GOTO END
)
IF %1==build_start_it_supported (
CALL :down
CALL :build
CALL :prepare-test
CALL :start
CALL :tail
GOTO END
)
IF %1==start (
CALL :start
CALL :tail
GOTO END
)
IF %1==stop (
CALL :down
GOTO END
)
IF %1==purge (
CALL:down
CALL:purge
GOTO END
)
IF %1==tail (
CALL :tail
GOTO END
)
IF %1==reload_share (
CALL :build_share
CALL :start_share
CALL :tail
GOTO END
)
IF %1==reload_acs (
CALL :build_acs
CALL :start_acs
CALL :tail
GOTO END
)
IF %1==build_test (
CALL :down
CALL :build
CALL :prepare-test
CALL :start
CALL :test
CALL :tail_all
CALL :down
GOTO END
)
IF %1==test (
CALL :test
GOTO END
)
echo "Usage: %0 {build_start|start|stop|purge|tail|reload_share|reload_acs|build_test|test}"
:END
EXIT /B %ERRORLEVEL%
:start
docker volume create becpg-artworks-acs-volume
docker volume create becpg-artworks-db-volume
docker volume create becpg-artworks-ass-volume
docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d
EXIT /B 0
:start_share
docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d becpg-artworks-share
EXIT /B 0
:start_acs
docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d becpg-artworks-acs
EXIT /B 0
:down
if exist "%COMPOSE_FILE_PATH%" (
docker-compose -f "%COMPOSE_FILE_PATH%" down
)
EXIT /B 0
:build
call %MVN_EXEC% clean package
EXIT /B 0
:build_share
docker-compose -f "%COMPOSE_FILE_PATH%" kill becpg-artworks-share
docker-compose -f "%COMPOSE_FILE_PATH%" rm -f becpg-artworks-share
call %MVN_EXEC% clean package -pl becpg-artworks-share,becpg-artworks-share-docker
EXIT /B 0
:build_acs
docker-compose -f "%COMPOSE_FILE_PATH%" kill becpg-artworks-acs
docker-compose -f "%COMPOSE_FILE_PATH%" rm -f becpg-artworks-acs
call %MVN_EXEC% clean package -pl becpg-artworks-integration-tests,becpg-artworks-platform,becpg-artworks-platform-docker
EXIT /B 0
:tail
docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
EXIT /B 0
:tail_all
docker-compose -f "%COMPOSE_FILE_PATH%" logs --tail="all"
EXIT /B 0
:prepare-test
call %MVN_EXEC% verify -DskipTests=true -pl becpg-artworks-platform,becpg-artworks-integration-tests,becpg-artworks-platform-docker
EXIT /B 0
:test
call %MVN_EXEC% verify -pl becpg-artworks-platform,becpg-artworks-integration-tests
EXIT /B 0
:purge
docker volume rm -f becpg-artworks-acs-volume
docker volume rm -f becpg-artworks-db-volume
docker volume rm -f becpg-artworks-ass-volume
EXIT /B 0