-
Notifications
You must be signed in to change notification settings - Fork 8
/
startup.cmd
105 lines (91 loc) · 2.07 KB
/
startup.cmd
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
@echo off
setlocal
set WORKDIR=%cd%
if exist .first_run (
set /p TYPECLONE=<.first_run
) else (
set /p TYPECLONE="Choose the cloning method: type ssh or https and press Enter: "
echo %TYPECLONE%
)
if %TYPECLONE%==ssh (
echo ssh > .first_run
) else if %TYPECLONE%==https (
echo https > .first_run
) else (
echo Wrong type! Try relaunch. Exit...
exit /b
)
call :type_clone %TYPECLONE%
IF "%1"=="" GOTO noArgs
if "%1%"=="--clean" (
echo Starting a clean launch...
GOTO clean_launch
)
:noArgs
echo No params, use normal startup
echo If you want a 'clean launch', use --clean as an argument; it removes all data and restarts all applications.
goto :run_compose
:type_clone
if %~1==ssh (
set [email protected]:SoftwareCountry/WhiteRabbit.git
set [email protected]:SoftwareCountry/ETL-CDMBuilder.git
set [email protected]:SoftwareCountry/DataQualityDashboard.git
) else (
set WR=https://github.com/SoftwareCountry/WhiteRabbit.git
set CDMB=https://github.com/SoftwareCountry/ETL-CDMBuilder.git
set DQC=https://github.com/SoftwareCountry/DataQualityDashboard.git
)
goto :eof
:clean_launch
docker-compose down
docker volume rm -f perseus_perseusdb
RD /S /Q ..\WhiteRabbit ..\DataQualityDashboard ..\ETL-CDMBuilder
:run_compose
cd %WORKDIR%\..
if exist WhiteRabbit\ (
call :git_pull WhiteRabbit
) else (
call :git_clone WhiteRabbit
)
if exist ETL-CDMBuilder\ (
call :git_pull CDMBuilder
) else (
call :git_clone CDMBuilder
)
if exist DataQualityDashboard\ (
call :git_pull DataQualityDashboard
) else (
call :git_clone DataQualityDashboard
)
cd %WORKDIR%
docker-compose build
docker-compose up -d
goto :eof
:git_pull
if %~1==WhiteRabbit (
pushd .
cd WhiteRabbit\
git pull
popd
) else if %~1==CDMBuilder (
pushd .
cd ETL-CDMBuilder\
git pull
popd
) else if %~1==DataQualityDashboard (
pushd .
cd DataQualityDashboard\
git pull
popd
)
goto :eof
:git_clone
if %~1==WhiteRabbit (
git clone %WR%
) else if %~1==CDMBuilder (
git clone %CDMB%
) else if %~1==DataQualityDashboard (
git clone %DQC%
)
goto :eof
endlocal