source: main/trunk/greenstone3/userweb.cmd@ 30568

Last change on this file since 30568 was 30568, checked in by ak19, 8 years ago

All the commits for a distributed GS3 on Windows (no changes made for linux yet). In a distributed GS3, the GS3 is installed in a read-only location and the tomcat runs from the writable TMP area, while the collections go to a writable userweb location specified by the user. (The DVD-only mode still works and is separate.) A problem remains, but exists in the TSG patched version too, and since the current commit breaks nothing, I'm committing it. The user needs to modify 4 properties in build.properties, one of which is new.They need to set using.user.web to true, set web.home to the userweb location, set gsdl3home.isreadonly to true and set gsdl3.writablehome to the tmpdir. The problem is that I can't successfully build the simple html collection if the GS3 installed location is read-only, as the perl code wants to create temporary files in gs2build\tmp which is read-only.

File size: 1.2 KB
Line 
1@echo off
2setlocal enabledelayedexpansion
3
4:: AFFECTED FILES:
5:: gli\gems.bat
6:: gli\gli.bat
7:: build.properties.in
8:: build.properties
9:: build.xml
10:: gs3-server.bat
11:: gs3-setup.bat
12:: userweb.cmd
13
14set INSTALLDIR=!GSDL3SRCHOME!
15set USERWEB=
16set IS_TMP_TOMCAT=
17
18:: Loosely based on http://stackoverflow.com/questions/7708681/how-to-read-from-a-properties-file-using-batch-script
19:: Replace forward slashes in web.home with back slashes
20:: http://scripts.dragon-it.co.uk/scripts.nsf/docs/batch-search-replace-substitute!OpenDocument&ExpandSection=3&BaseTarget=East&AutoFramed
21for /F "tokens=1,2 delims==" %%G in (!GSDL3SRCHOME!\build.properties) do (
22 if "%%G"=="web.home" set USERWEB=%%H& set USERWEB=!USERWEB:/=\!
23 if "%%G"=="gsdl3home.isreadonly" set IS_TMP_TOMCAT=%%H
24)
25echo USERWEB: !USERWEB!
26echo IS_TMP_TOMCAT: !IS_TMP_TOMCAT!
27
28if "!USERWEB!" == "" echo No userweb directory provided & echo. & goto done
29
30:: add exclusion of log folder
31robocopy /e "!INSTALLDIR!\web" "!USERWEB!" /xd "!INSTALLDIR!\web\sites\localsite\collect" "!INSTALLDIR!\web\WEB-INF" > CON
32robocopy "!INSTALLDIR!\web\WEB-INF" "!USERWEB!\WEB-INF" > CON
33md !USERWEB!\sites\localsite\collect
34
35
36:done
37endlocal & set USERWEB=%USERWEB%
38
39:end
Note: See TracBrowser for help on using the repository browser.