-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildMain.sh
217 lines (185 loc) · 5.6 KB
/
buildMain.sh
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#!/bin/bash
USERNAME=$1
SITEPASS=$2
HOSTS=$3
GITHASH=$4
DBPASS=$5
#echo $SITEPASS
#echo $USERNAME
#echo $DBPASS
#echo $HOSTS
#echo $GITHASH
################################################
# DATABASE
################################################
# Database
# DONE - backup
# DONE - download
# upload
# import locally
# import on a server
function backupDatabaseOnServer() {
echo "backing up database on server"
sshpass -p "$SITEPASS" ssh cdrchops@63.142.255.175 "\/home/cdrchops/backupDB.sh Tk02030#"
}
function pullDatabaseFromServer() {
echo "pulling sql dump from server"
sshpass -p "$SITEPASS" scp cdrchops@63.142.255.175:/home/cdrchops/dump.sql.gz ./dump.sql.gz
}
# site
# DONE - upload latest war
# DONE - go to server
# DONE - restart server
# start react server
# stop react client
# start react client
# stop react server
# start both react client and server
# stop both react client and server
function updateServerWithLatestWar() {
echo "updateServerWithLatestWar"
sshpass -p "$SITEPASS" scp ./dictionary/build/libs/dictionary-0.1.war cdrchops@63.142.255.175:~/ROOT.war
}
function goToServer() {
sshpass -p "$SITEPASS" ssh cdrchops@63.142.255.175
}
function restartServer() {
echo "restarting server"
sshpass -p "$SITEPASS" ssh cdrchops@63.142.255.175 "\/home/cdrchops/deployWar.sh"
}
# build
# DONE - copyGrammarGuide
# DONE - copyGrooscript
# build - each project - try to rely on gradle as much as possible
function copyGrammarGuide() {
echo -e "copy grammar guide to dictionary"
cp ./grammar/hold1.txt ./dictionary/grails-app/assets/javascripts/hold1.txt
cp ./grammar/hold2.txt ./dictionary/grails-app/assets/javascripts/hold2.txt
}
function copyGrooscript() {
echo -e "copy grooscript conversion to dictionary"
cp ./deconstructor/src/main/webapp/js/**/*.js ./dictionary/grails-app/assets/javascripts/deconstructor
}
function build() {
echo "build "$1
cd $1
gradle clean build publishToMavenLocal publish
cd ..
}
#takes a parameter for the path
function buildDictionary() {
copyGrammarGuide
//copyGrooscript
echo -e "build dictionary"
cd $1dictionary
grails clean
grails prod war
cd ..
}
function buildUtilities() {
build "utilities" ./
}
function buildTransliteration() {
build "transliteration" ./
}
function buildConjugation() {
build "conjugation" ./
}
function buildDateTime() {
build "dateTime" ./
}
function buildGrooscript() {
build "grooscript" ./
# cd grooscript
# gradle clean build publishToMavenLocal
# cd ..
}
function buildGrooscriptPlugin() {
build "grooscript-plugins" ./
# cd grooscript-plugins
# gradle clean build publishToMavenLocal
# cd ..
}
function buildDeconstructor() {
cd deconstructor
gradle clean build convert
cd ..
}
function buildAll() {
echo -e "building all"
buildTransliteration
buildUtilities
buildConjugation
buildDateTime
#buildGrooscript
#buildGrooscriptPlugin
#buildDeconstructor
# build "transliteration"
# build "utilities"
# build "conjugation"
# build "dateTime"
# build "deconstruction"
buildDictionary
}
################################################
# GIT
################################################
# GIT COMMANDS
# clone
# reset
# add
# commit
# update local git
# status
# add commit directory
function gitPush() {
echo "git push"
}
function gitClone() {
echo -e "clone repos"
host=https://$GITHASH@github.com
# This is already chacked out as evidenced by the ability to read this script
# https://github.com/CherokeeLanguage/cedproject.git
git clone $host/CherokeeLanguage/cherokeetransliteration.git transliteration
git clone $host/CherokeeLanguage/cherokeeutilities.git utilities
git clone $host/CherokeeLanguage/cherokeeconjugation.git conjugation
#git clone $host/CherokeeLanguage/cedLibrariesForWindows.git
git clone $host/CherokeeLanguage/cherokeedictionary.git dictionary
git clone $host/CherokeeLanguage/cedgrammarguide.git grammar
git clone $host/CherokeeLanguage/CherokeeDateTime.git dateTime
#git clone $host/CherokeeLanguage/cherokeeDeconstructor.git deconstructor
#git clone $host/cdrchops/grooscript.git grooscript
#git clone $host/cdrchops/grooscript-plugins.git
#git clone $host/CherokeeLanguage/reactCED.git reactCED
#git clone https://github.com/node-gradle/gradle-node-plugin
}
function installSDKsLinux() {
#!/bin/bash
#https://www.windowscentral.com/how-backup-windows-subsystem-linux-wsl-distribution
sudo apt update && sudo apt upgrade
sudo apt dist-upgrade
sudo apt-get install dist-upgrade git wget curl zip unzip lsb-release gnupg sshpass -Y
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java 8.0.292.j9-adpt
sdk install gradle 6.9.2
sdk install gradle 3.5
sdk install grails 4.0.11
sudo apt-get install mariadb-client mariadb-server
#https://serverspace.io/support/help/how-to-install-mysql-on-debian-10/
#sudo apt-get install default-mysql-server #don't use this one
wget https://dev.mysql.com/get/mysql-apt-config_0.8.22-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.22-1_all.deb
#apt-get update
#sudo apt install mysql-server
#sudo apt-get install mysql-community-server
#/usr/bin/mysql -u root -p
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc
nvm install node
npm install gulp-cli
}
function tasks() {
compgen -A function
}
$6