💚 Fix docker automatic update (#61)

* 💚 Fix docker automatic update

💚 修复 docker build ci

📝 更新存储库地址
This commit is contained in:
Xtao_dada 2021-04-15 00:23:12 +08:00 committed by GitHub
parent 17bf5b2d90
commit 77fdc6f4a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View File

@ -23,7 +23,6 @@ RUN pacman -Syu --needed --noconfirm \
neofetch \
sudo \
gcc \
gcc8 \
imagemagick \
libwebp \
zbar \
@ -35,7 +34,7 @@ RUN useradd pagermaid -r -m -d /pagermaid
RUN usermod -aG wheel,users pagermaid
USER pagermaid
RUN mkdir /pagermaid/workdir
RUN git clone -b master https://github.com/xtaodada/PagerMaid-Modify.git /pagermaid/workdir
RUN git clone -b master https://github.com/Xtao-Labs/PagerMaid-Modify.git /pagermaid/workdir
WORKDIR /pagermaid/workdir
RUN python3 -m virtualenv venv
RUN source venv/bin/activate; pip3 install -r requirements.txt

View File

@ -23,7 +23,6 @@ RUN pacman -Syu --needed --noconfirm \
neofetch \
sudo \
gcc \
gcc8 \
imagemagick \
libwebp \
zbar \
@ -34,7 +33,7 @@ RUN useradd pagermaid -r -m -d /pagermaid
RUN usermod -aG wheel,users pagermaid
USER pagermaid
RUN mkdir /pagermaid/workdir
RUN git clone -b master https://github.com/xtaodada/PagerMaid-Modify.git /pagermaid/workdir
RUN git clone -b master https://github.com/Xtao-Labs/PagerMaid-Modify.git /pagermaid/workdir
WORKDIR /pagermaid/workdir
RUN python3 -m virtualenv venv
RUN source venv/bin/activate; pip3 install -r requirements.txt

View File

@ -5,6 +5,7 @@ from subprocess import run, PIPE
from datetime import datetime
from time import strftime
from os import remove
from os.path import exists
from git import Repo
from git.exc import GitCommandError, InvalidGitRepositoryError, NoSuchPathError
from pagermaid import log
@ -23,7 +24,7 @@ async def update(context):
parameter = None
if len(context.parameter) == 1:
parameter = context.parameter[0]
repo_url = 'https://github.com/xtaodada/PagerMaid-Modify.git'
repo_url = 'https://github.com/Xtao-Labs/PagerMaid-Modify.git'
if parameter:
if parameter == "debug":
@ -121,8 +122,12 @@ async def update(context):
await execute("git pull")
await execute("""cd ../for-update/ && find -H . -type f | awk '{print "cp " $1 " ../PagerMaid-Modify/" $1}' | sh && cd ../PagerMaid-Modify""")
await execute("rm -rf ../for-update/")
await execute("python3 -m pip install -r requirements.txt --upgrade")
await execute("python3 -m pip install -r requirements.txt")
if not exists('install.lock'):
await execute("python3 -m pip install -r requirements.txt --upgrade")
await execute("python3 -m pip install -r requirements.txt")
else:
await execute("/pagermaid/workdir/venv/bin/python -m pip install -r requirements.txt --upgrade")
await execute("/pagermaid/workdir/venv/bin/python -m pip install -r requirements.txt")
await log(f"PagerMaid-Modify {lang('update_is_updated')}")
await context.edit(lang('update_success') + lang('apt_reboot'))
await context.client.disconnect()