forked from mathematicalthinking/vmt
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy-mac.sh
More file actions
48 lines (46 loc) · 1.47 KB
/
deploy-mac.sh
File metadata and controls
48 lines (46 loc) · 1.47 KB
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
#!/bin/bash
echo -e "\e[1;33m Making a $1 build"
echo -e "\e[1;30m"
if [ -d "./client/build" ]; then
rm -rf ./client/build
fi
if [ -d "./client/encompassBuild" ]; then
rm -rf ./client/encompassBuild
fi
cd ./server
npm run build-$1
npm run build-enc-$1
cd ..
if [ -d "./$1" ]; then
rm -rf ./$1
fi
mkdir ./$1
cd ./$1
mkdir ./server
cd ..
echo "made $1 directory"
cd ./server
cp -r ./bin ./config ./constants ./controllers ./db_migration ./middleware ./models ./routes ./services ../$1/server
echo "\e[1;33m server copied to $1"
cp app.js package.json socketInit.js sockets.js ../$1/server
cp .env ../$1
echo "\e[1;33mfiles copied"
cd ../$1
mkdir client
mkdir client/build
mkdir client/encompassBuild
cp -r ../client/build/ client/build
cp -r ../client/encompassBuild/ client/encompassBuild
echo -e "\e[1;33m Zipping...\e[0m"
zip -r VMT-$1.zip .
echo -e "\e[1;33m Copying zipped directory...\e[0m"
# scp ./VMT-$1.zip "$1"@mathematicalthinking.org:/tmp/
# echo -e "\e[1;31m You're not done yet!\e[0m"
# echo -e "\e[1;35m run the following commands to complete the demployment proces"
# echo -e "\e[1;34m $ \e[0m ssh $1@mathematicalthinking"
# echo -e "\e[1;34m $ \e[0m cd /web/mathematicalthinking/vmt"
# echo -e "\e[1;34m $ \e[0m rm -rf staging && mkdir staging && cd staging"
# echo -e "\e[1;34m $ \e[0m mv /tmp/VMT-$1.zip ."
# echo -e "\e[1;34m $ \e[0m unzip VMT-$1.zip"
# echo -e "\e[1;34m $ \e[0m cd ./server && npm install --only=production"
# echo -e "\e[1;34m $ \e[0m systemctl restart vmt-$1"