-
Notifications
You must be signed in to change notification settings - Fork 13
/
check-system.cmd
executable file
·50 lines (43 loc) · 1.38 KB
/
check-system.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
@echo off
CALL :validateDocker
CALL :validateKata fizz-buzz "docker run --rm -v %CD%:/kata codiumteam/tdd-training-java make test"
CALL :validateKata roman-numerals "docker run --rm -v %CD%:/kata codiumteam/tdd-training-java make test"
CALL :validateKata password-validator "docker run --rm -v %CD%:/kata codiumteam/tdd-training-java make test"
CALL :validateKata user-registration "docker run --rm -v %CD%:/kata codiumteam/tdd-training-java make test"
CALL :validateKata coffee-machine "docker run --rm -v %CD%:/kata codiumteam/tdd-training-java make test"
goto :eof
:validateKata
echo Validating %1...
pushd %1
CALL %~2
popd
goto :eof
:validateDocker
echo Validating docker running...
docker ps >NUL: 2>NUL:
IF ERRORLEVEL 1 (
echo Error
echo Are you sure that you have docker running?
goto :eof
) else (
echo "Ok"
)
echo Creating docker image...
docker pull codiumteam/tdd-training-java >NUL: 2>NUL:
IF ERRORLEVEL 1 (
echo Error
echo Do you have internet connection?
goto :eof
) else (
echo Ok
)
echo Validating docker mount permissions...
docker run --rm -v "%CD%":/opt -w /opt codiumteam/tdd-training-java ls >NUL: 2>NUL:
IF ERRORLEVEL 1 (
echo Error
echo Are you sure that you have permissions to mount your volumes?
goto :eof
) else (
echo Ok
)
goto :eof