-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.bat
87 lines (64 loc) · 3.65 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
87
@echo off
echo ###################################################################
echo # #
echo # Performing initial setup....... #
echo # This is a one time setup and need not be triggered again. #
echo # #
echo ###################################################################
set /p skipJ="Is Java 8 already installed: "
if /i %skipJ% == y goto:skipJavaInstall
if /i %skipJ% == yes goto:skipJavaInstall
Powershell.exe -executionpolicy remotesigned Invoke-WebRequest -OutFile javaInstaller.exe http://javadl.oracle.com/webapps/download/AutoDL?BundleId=230511_2f38c3b165be4555a1fa6e98c45e0808
Powershell.exe -executionpolicy remotesigned ./javaInstaller.exe
echo Java installation started.......
:skipJavaInstall
echo If you don't need local MongoDb server, say yes.
set /p skipM="Is MongoDb already installed: "
if /i %skipM% == y goto:skipMongodbInstall
if /i %skipM% == yes goto:skipMongodbInstall
Powershell.exe -executionpolicy remotesigned Invoke-WebRequest -OutFile mongodbInstaller.msi https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.6.2-signed.msi
Powershell.exe -executionpolicy remotesigned ./mongodbInstaller.msi
echo MongoDB installation started.......
:skipMongodbInstall
echo ###################################################################
echo # #
echo # Creating application.properties....... #
echo # Please provide required configuration details. #
echo # You can edit them but that would take affect after app restart. #
echo # #
echo ###################################################################
set /p hostM="MongoDB host: "
set /p portM="MongoDB port: "
set /p dbM="MongoDB db: "
set /p user="MongoDB username: "
set /p pass="MongoDB password: "
set /p path="Resume base path: "
echo spring.data.mongodb.uri=mongodb://%hostM%:%portM%/%dbM%> "application.properties"
if not defined user goto:skipCred
if not defined pass goto:skipCred
echo spring.data.mongodb.username=%user%>> "application.properties"
echo spring.data.mongodb.password=%pass%>> "application.properties"
:skipCred
echo application.resume.location=%path%>> "application.properties"
echo ###################################################################
echo # #
echo # Creating start script. #
echo # #
echo ###################################################################
echo @echo off> "start.bat"
if /i %skipM% == y goto:skipMongodbSteps
if /i %skipM% == yes goto:skipMongodbSteps
mkdir ./data
set /p mongoLoc="MongoDB server dir: "
echo start cmd /k "%mongoLoc%/bin/mongod.exe" --dbpath ./data>> ./start.bat
:skipMongodbSteps
set /p javaLoc="Java jdk dir: "
echo start cmd /k "%javaLoc%/bin/java" -jar ./resume_engine.jar>> ./start.bat
echo ###################################################################
echo # #
echo # Script created. #
echo # To start application, run start.bat #
echo # To stop application, run stop.bat #
echo # #
echo ###################################################################
pause