Skip to content

Commit 262a3a7

Browse files
authored
Merge pull request #291 from AmiyaBot/V6-dev
V6 dev
2 parents 7610824 + ffade70 commit 262a3a7

File tree

5 files changed

+27
-13
lines changed

5 files changed

+27
-13
lines changed

.dockerignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
Dockerfile
2-
docker.sh
3-
install.sh
2+
dockersh/
3+
black.sh
4+
.git/
5+
.gitignore
6+
.gitmodules
7+
pluginsDev/
8+
pluginsServer/

.github/workflows/package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ jobs:
5555
with:
5656
context: .
5757
push: true
58-
tags: amiyabot/amiyabot:latest
58+
tags: amiyabot/amiyabot:2.0.2, amiyabot/amiyabot:latest

Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ WORKDIR /app
1010
# 守护端口
1111
EXPOSE 8088
1212

13-
# 拷贝当前目录下的所有文件到工作目录
13+
# 工作目录
1414
COPY requirements.txt /app
1515
COPY entrypoint.sh /app
16-
COPY . /temp
17-
RUN tar -zcvf amiyabot.tar.gz --exclude=/temp/.git --exclude=/temp/.vscode --exclude=/temp/.idea --exclude=/temp/docker.sh \
18-
--exclude=/temp/entrypoint.sh --exclude=/temp/install.sh --exclude=/temp/Dockerfile /temp/*
16+
17+
# 临时目录
18+
COPY . /app/temp
19+
WORKDIR /app/temp
20+
RUN tar -zcvf amiyabot.tar.gz --exclude=.git --exclude=.vscode --exclude=.idea --exclude=docker.sh \
21+
--exclude=entrypoint.sh --exclude=install.sh --exclude=Dockerfile *
22+
RUN mv amiyabot.tar.gz /app
23+
WORKDIR /app
24+
RUN rm -rf temp
1925

2026
# 安装依赖
2127
RUN pip install -r requirements.txt

install.sh renamed to dockersh/install.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ while true; do
161161
read confirm
162162
if [ "$confirm" ]; then
163163
if [ "$confirm" = "y" ]; then
164+
sudo docker pull amiyabot/amiyabot:latest
164165
eval $command
166+
echo "服务已启动, 控制台地址: http://<本机ip>:$port"
165167
break
166168
elif [ "$confirm" = "n" ]; then
167169
echo "已取消"

entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
BOT_FOLDER=/amiyabot
44

5-
if [ ! -f "$BOT_FOLDER/first_run" ]; then
6-
# step 1: 解压bot本体
5+
# step 1: 解压/覆盖bot文件
6+
if [ -f "amiyabot.tar.gz" ]; then
77
tar -zxvf amiyabot.tar.gz -C $BOT_FOLDER
8-
# step 2: 进入bot目录
8+
fi
9+
10+
# step 2: 判断是否首次运行
11+
if [ ! -f "$BOT_FOLDER/first_run" ]; then
912
cd $BOT_FOLDER
10-
# step 3: 初始化配置文件
1113
python entrypoint.py
12-
# step 4: 标记已初始化
1314
touch first_run
1415
fi
1516

16-
# step 5: 运行bot
17+
# step 3: 启动bot
1718
cd $BOT_FOLDER
1819
python amiya.py

0 commit comments

Comments
 (0)