-
Notifications
You must be signed in to change notification settings - Fork 2
/
run-faircamp.cmd
86 lines (68 loc) · 2.6 KB
/
run-faircamp.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
@echo off
:: Disable the Docker scout messages for the pull command etc.
SET DOCKER_CLI_HINTS=false
echo.
echo _______ _______ ___ ______ _______ _______ __ __ _______
echo ^| ^| ^| ^| _ ^| ^| ^| ^| ^|_^| ^| ^|
echo ^| ___^| _ ^| ^| ^| ^|^| ^| ^| _ ^| ^| _ ^|
echo ^| ^|___^| ^|_^| ^| ^| ^|_^|^|_^| _^| ^|_^| ^| ^| ^|_^| ^|
echo ^| ___^| ^| ^| __ ^| ^| ^| ^| ^| ___^|
echo ^| ^| ^| _ ^| ^| ^| ^| ^| ^|_^| _ ^| ^|^|_^|^| ^| ^|
echo ^|___^| ^|__^| ^|__^|___^|___^| ^|_^|_______^|__^| ^|__^|_^| ^|_^|___^|
echo -- in docker -- https://github.com/n3wjack/faircamp-docker
echo.
if NOT EXIST "%cd%\data" (
echo Whoops. You do not have a .\data folder in the current folder: %cd%
echo Please create the folder, and put your Faircamp/music files in the folder. See the Faircamp manual for more information.
echo.
pause
goto :EOF
)
if "%1"=="" (
echo Using latest version.
SET TAG=latest
) else (
SET TAG=%1
echo Using specified version %1
)
:pull
:: Check if the image has been downloaded already.
docker images n3wjack/faircamp:%TAG% | findstr "n3wjack/faircamp" > nul
if %ERRORLEVEL%==0 goto :build
:: Try and pull the image.
docker pull n3wjack/faircamp:%TAG%
if NOT %ERRORLEVEL%==0 (
echo.
echo *****************************************************************************************
echo.
echo ERROR :(
echo.
echo There was an issue getting the version with tag %TAG%
echo Please check if the given version matches the tags available for the Docker image here:
echo https://hub.docker.com/repository/docker/n3wjack/faircamp/tags
echo.
echo *****************************************************************************************
echo.
goto :EOF
)
:build
docker run -ti --rm n3wjack/faircamp:%TAG% --version
echo.
echo Building the Faircamp site in %cd%\data\.faircamp_build ...
echo.
docker run -ti -v %cd%\data:/data --rm n3wjack/faircamp:%TAG%
echo.
echo Building a browsable version in %cd%\data\.faircamp_build_browsable ...
echo.
docker run -ti -v %cd%\data:/data --rm n3wjack/faircamp:%TAG% --build-dir .faircamp_build_browsable --no-clean-urls
echo.
echo You can find your Faircamp site to upload in:
echo - %cd%\data\.faircamp_build
echo.
echo A browseable version can be found in:
echo - %cd%\data\.faircamp_build_browsable
echo.
start %cd%/data/.faircamp_build_browsable/index.html
set /p response=Do you want to do another build, or stop? [y/n] :
echo.
if /I %response%==y goto :build