💚 Fix docker automatic update (#61)
* 💚 Fix docker automatic update 💚 修复 docker build ci 📝 更新存储库地址
This commit is contained in:
parent
17bf5b2d90
commit
77fdc6f4a4
@ -23,7 +23,6 @@ RUN pacman -Syu --needed --noconfirm \
|
|||||||
neofetch \
|
neofetch \
|
||||||
sudo \
|
sudo \
|
||||||
gcc \
|
gcc \
|
||||||
gcc8 \
|
|
||||||
imagemagick \
|
imagemagick \
|
||||||
libwebp \
|
libwebp \
|
||||||
zbar \
|
zbar \
|
||||||
@ -35,7 +34,7 @@ RUN useradd pagermaid -r -m -d /pagermaid
|
|||||||
RUN usermod -aG wheel,users pagermaid
|
RUN usermod -aG wheel,users pagermaid
|
||||||
USER pagermaid
|
USER pagermaid
|
||||||
RUN mkdir /pagermaid/workdir
|
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
|
WORKDIR /pagermaid/workdir
|
||||||
RUN python3 -m virtualenv venv
|
RUN python3 -m virtualenv venv
|
||||||
RUN source venv/bin/activate; pip3 install -r requirements.txt
|
RUN source venv/bin/activate; pip3 install -r requirements.txt
|
||||||
|
@ -23,7 +23,6 @@ RUN pacman -Syu --needed --noconfirm \
|
|||||||
neofetch \
|
neofetch \
|
||||||
sudo \
|
sudo \
|
||||||
gcc \
|
gcc \
|
||||||
gcc8 \
|
|
||||||
imagemagick \
|
imagemagick \
|
||||||
libwebp \
|
libwebp \
|
||||||
zbar \
|
zbar \
|
||||||
@ -34,7 +33,7 @@ RUN useradd pagermaid -r -m -d /pagermaid
|
|||||||
RUN usermod -aG wheel,users pagermaid
|
RUN usermod -aG wheel,users pagermaid
|
||||||
USER pagermaid
|
USER pagermaid
|
||||||
RUN mkdir /pagermaid/workdir
|
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
|
WORKDIR /pagermaid/workdir
|
||||||
RUN python3 -m virtualenv venv
|
RUN python3 -m virtualenv venv
|
||||||
RUN source venv/bin/activate; pip3 install -r requirements.txt
|
RUN source venv/bin/activate; pip3 install -r requirements.txt
|
||||||
|
@ -5,6 +5,7 @@ from subprocess import run, PIPE
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from time import strftime
|
from time import strftime
|
||||||
from os import remove
|
from os import remove
|
||||||
|
from os.path import exists
|
||||||
from git import Repo
|
from git import Repo
|
||||||
from git.exc import GitCommandError, InvalidGitRepositoryError, NoSuchPathError
|
from git.exc import GitCommandError, InvalidGitRepositoryError, NoSuchPathError
|
||||||
from pagermaid import log
|
from pagermaid import log
|
||||||
@ -23,7 +24,7 @@ async def update(context):
|
|||||||
parameter = None
|
parameter = None
|
||||||
if len(context.parameter) == 1:
|
if len(context.parameter) == 1:
|
||||||
parameter = context.parameter[0]
|
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:
|
||||||
if parameter == "debug":
|
if parameter == "debug":
|
||||||
@ -121,8 +122,12 @@ async def update(context):
|
|||||||
await execute("git pull")
|
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("""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("rm -rf ../for-update/")
|
||||||
await execute("python3 -m pip install -r requirements.txt --upgrade")
|
if not exists('install.lock'):
|
||||||
await execute("python3 -m pip install -r requirements.txt")
|
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 log(f"PagerMaid-Modify {lang('update_is_updated')}")
|
||||||
await context.edit(lang('update_success') + lang('apt_reboot'))
|
await context.edit(lang('update_success') + lang('apt_reboot'))
|
||||||
await context.client.disconnect()
|
await context.client.disconnect()
|
||||||
|
Loading…
Reference in New Issue
Block a user