-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 新增部署脚本 * feat: 新增部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本 * fix: 完善部署脚本
- Loading branch information
Showing
9 changed files
with
354 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
echo "::: Welcome to IM-WhaleShark :::" | ||
|
||
# 删除 build 文件夹 | ||
echo "开始清理 build 文件夹 .." | ||
rm -rf docker/build/ | ||
echo "清理完成" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# 1. docker | ||
## 安装 | ||
```bash | ||
curl -sSL https://get.daocloud.io/docker | sh | ||
``` | ||
或者 | ||
```bash | ||
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun | ||
``` | ||
## 启动、停止 | ||
|
||
### systemctl 方式 | ||
|
||
重启docker服务 | ||
|
||
``` | ||
sudo systemctl restart docker | ||
``` | ||
|
||
关闭docker | ||
|
||
``` | ||
sudo systemctl stop docker | ||
``` | ||
|
||
### service 方式 | ||
|
||
重启docker服务 | ||
|
||
```bash | ||
sudo service docker restart | ||
``` | ||
|
||
关闭docker | ||
|
||
```bash | ||
sudo service docker stop | ||
``` | ||
|
||
# 2. docker-compose安装 | ||
|
||
```bash | ||
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | ||
``` | ||
|
||
```bash | ||
chmod +x /usr/local/bin/docker-compose | ||
``` | ||
|
||
# 3. 安装git | ||
``` | ||
ubuntu系统上执行 apt install git | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
# 检查是否为root用户 | ||
if [ "$(id -u)" -ne 0 ]; then | ||
echo "Error: This script must be run as root." | ||
exit 1 | ||
fi | ||
|
||
echo "::: Welcome to IM-WhaleShark :::" | ||
|
||
# 定义要开启的端口列表 | ||
ports=(3306 13306 6379 18000 18001 19001 19002 2181 2888 3888 5672 15672) | ||
|
||
# 开启端口 | ||
open_ports() { | ||
for port in "${ports[@]}"; do | ||
echo "Opening port $port..." | ||
firewall-cmd --zone=public --add-port=$port/tcp --permanent | ||
done | ||
echo "Reloading firewall..." | ||
firewall-cmd --reload | ||
echo "Ports opened successfully!" | ||
} | ||
|
||
# 关闭端口 | ||
close_ports() { | ||
for port in "${ports[@]}"; do | ||
echo "Closing port $port..." | ||
firewall-cmd --zone=public --remove-port=$port/tcp --permanent | ||
done | ||
echo "Reloading firewall..." | ||
firewall-cmd --reload | ||
echo "Ports closed successfully!" | ||
} | ||
|
||
# 判断是否传入参数 | ||
if [[ $# -eq 0 ]]; then | ||
echo "Usage: $0 [open|close]" | ||
exit 1 | ||
fi | ||
|
||
# 根据传入的参数调用相应的函数 | ||
if [[ $1 == "open" ]]; then | ||
open_ports | ||
elif [[ $1 == "close" ]]; then | ||
close_ports | ||
else | ||
echo "Usage: $0 [open|close]" | ||
exit 1 | ||
fi | ||
|
||
exit 0 |