This repository has been archived by the owner on Aug 21, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.bat
86 lines (64 loc) · 3.35 KB
/
install.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
::@echo off
:: run node.js executable/installer wizard
Executables\node-v0.10.26-x86.msi
:: run couchdb executable/installer wizard
Executables\setup-couchdb-1.5.0_R16B02.exe
:: run Ghostscript installer wizard
Executables\gs914w64.exe
:: run GraphicsMagick installer wizard
Executables\GraphicsMagick-1.3.19-Q16-win64.exe
timeout 2
:: run couchdb server, in case it was not installed as a service by user
cmd /c .\Executables\startcouchdb.bat
:: configure couchdb to be accessible to any node on the LAN
curl -X PUT http://localhost:5984/_config/httpd/bind_address -d "\"0.0.0.0\""
:: delete databases
FOR /R BeLL-Apps\databases %%F in (*.*) do (
curl -X DELETE http://localhost:5984/%%~nF
)
:: create databases
FOR /R BeLL-Apps\databases %%F in (*.*) do (
curl -X PUT http://localhost:5984/%%~nF
)
:: add language docs
FOR /R BeLL-Apps\init_docs\languages %%F in (*.*) do (
curl -d @%%F -H "Content-Type: application/json" -X POST http://localhost:5984/languages
)
:: add bare minimal required data to couchdb for launching bell-apps smoothly
curl -d @BeLL-Apps\init_docs\ConfigurationsDoc-Community.txt -H "Content-Type: application/json" -X POST http://localhost:5984/configurations
:: curl -d @BeLL-Apps\init_docs\admin.txt -H "Content-Type: application/json" -X POST http://localhost:5984/members
:: delete empty dbs we want to replace with Starter data dbs
curl -X DELETE http://localhost:5984/collectionlist
curl -X DELETE http://localhost:5984/resources
curl -X DELETE http://localhost:5984/groups
curl -X DELETE http://localhost:5984/coursestep
set couchdb_databases_folder="C:\Program Files (x86)\Apache Software Foundation\CouchDB\var\lib\couchdb\"
set starter_data_folder="StarterData\"
:: copy the resources, collectionlist, groups, and coursestep db files into the couchdb_databases_folder
copy /y %starter_data_folder%resources.couch %couchdb_databases_folder%resources.couch
copy /y %starter_data_folder%collectionlist.couch %couchdb_databases_folder%collectionlist.couch
copy /y %starter_data_folder%groups.couch %couchdb_databases_folder%groups.couch
copy /y %starter_data_folder%coursestep.couch %couchdb_databases_folder%coursestep.couch
:: if "Starter_Data" folder did not have any data in it, then we need to create the databases again
curl -X PUT http://localhost:5984/collectionlist
curl -X PUT http://localhost:5984/coursestep
curl -X PUT http://localhost:5984/groups
curl -X PUT http://localhost:5984/resources
:: Move specific Dosign Docs from Databases to anywhere else
move BeLL-Apps\databases\communities.js BeLL-Apps\communities.js
move BeLL-Apps\databases\languages.js BeLL-Apps\languages.js
move BeLL-Apps\databases\configurations.js BeLL-Apps\configurations.js
SET PATH=%PATH%;C:\Users\%USERNAME%\AppData\Roaming\npm;C:\Program Files (x86)\nodejs\
call .\install_nodemodules.bat
:: add design docs to all databases
FOR /R BeLL-Apps\databases %%F in (*.*) do (
call BeLL-Apps\node_modules\.bin\couchapp push BeLL-Apps\databases\%%~nxF http://localhost:5984/%%~nF
timeout 1
)
:: Move specific Dosign Docs back to databases
move BeLL-Apps\communities.js BeLL-Apps\databases\communities.js
move BeLL-Apps\languages.js BeLL-Apps\databases\languages.js
move BeLL-Apps\configurations.js BeLL-Apps\databases\configurations.js
start Launch_PDFOptimizer.bat
call .\create_desktop_icon.bat
start firefox http://127.0.0.1:5984/apps/_design/bell/MyApp/index.html#admin/add