-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
41 lines (34 loc) · 972 Bytes
/
install.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
service postgresql start
sudo -u postgres psql -f /home/conf/database-setup.sql
domain="$domain"
echo "도메인: $domain"
prefix="$prefix"
echo "prefix: $prefix"
git clone https://github.com/LightSwitch-S202/OpenSource.git
cd /OpenSource
echo frontend build
cd ./frontend
if [ -n "$prefix" ]; then
echo "VITE_SERVER_BASEURL=$domain"$'\n'"VITE_BASE_URL=$prefix" > .env
else
echo "VITE_SERVER_BASEURL=$domain" > .env
fi
yarn install
yarn build
cd /var/www/html
if [ -n "$prefix" ]; then
mkdir /var/www/html$prefix
fi
cp -r /OpenSource/frontend/dist/* /var/www/html$prefix
nginx_config="/etc/nginx/sites-enabled/default"
sed -i "s|\$prefix|${prefix:-}|g" $nginx_config
service nginx start
cd /OpenSource
echo backend build
cd ./backend/core-service
chmod +x ./gradlew
./gradlew clean assemble
cd ./build/libs
jar_file=$(ls *.jar)
echo "실행할 .jar 파일: $jar_file"
java -jar -Dspring.cors.domain=$domain -Dserver.servlet.context-path=$prefix/api $jar_file