-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·50 lines (43 loc) · 1.04 KB
/
deploy.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
#!/bin/bash
#====================================================
# System Request:Ubuntu 18.04+
# Author: chenchao
# Dscription: Dice 部署脚本
# Version: 1.0
# email:[email protected]
# Official document: https://bihell.gitee.io/big-data/project/dice.html
#====================================================
#fonts color
Green="\033[32m"
Red="\033[31m"
Yellow="\033[33m"
GreenBG="\033[42;37m"
RedBG="\033[41;37m"
Font="\033[0m"
#notification information
Info="${Green}[信息]${Font}"
OK="${Green}[OK]${Font}"
Error="${Red}[错误]${Font}"
judge(){
if [[ $? -eq 0 ]];then
echo -e "${OK} ${GreenBG} $1 完成 ${Font}"
sleep 1
else
echo -e "${Error} ${RedBG} $1 失败${Font}"
exit 1
fi
}
# 安装 Dice-Admin 依赖
cd ./dice-admin/ && npm install
judge "安装 Dice-Admin 项目依赖"
# 编译 Dice-Admin 项目
npm run build:prod
judge "编译 Dice-Admin 项目"
cd -
# docker 部署
docker-compose build
judge "生成容器"
docker-compose down
judge "停止容器"
docker-compose up -d
judge "启动容器"