1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-11-08 21:21:06 +00:00

Update poetry update function

This commit is contained in:
Mo 2022-05-07 17:01:05 +02:00
parent e005e2d0e9
commit f89059f4ac
4 changed files with 6 additions and 13 deletions

View file

@ -5,7 +5,7 @@ from shutil import copy2
from flask import flash, has_request_context
from advlabdb import app, db
from advlabdb import db
from advlabdb.exceptions import DataBaseImportException
from advlabdb.models import (
Appointment,

View file

@ -7,7 +7,7 @@ script_dir = Path(__file__).parent.absolute()
sys.path.insert(0, str(script_dir))
from shared import install_latest_pipx, local_bin, poetry_install_latest, run, step
from shared import install_latest_pipx, local_bin, poetry_update, run, step
logs_dir = Path("/var/log/advlabdb/")
@ -84,7 +84,7 @@ root_update_log = logs_dir / "root_update.log"
run(f'echo "15 4 * * 0 root python3 -u {root_update_script} &>> {root_update_log}" | sudo tee -a /etc/crontab')
step("Install latest Poetry packages")
poetry_install_latest(script_dir)
poetry_update(script_dir)
step("Deactivate the 'root' user")
run("sudo passwd -l root")

View file

@ -46,7 +46,7 @@ def install_latest_pipx():
run("pip install --user --upgrade pipx")
def poetry_install_latest(script_dir):
def poetry_update(script_dir):
poetry_bin = local_bin / "poetry"
run(f"{poetry_bin} update", cwd=script_dir / "..")

View file

@ -8,14 +8,7 @@ script_dir = Path(__file__).parent.absolute()
sys.path.insert(0, str(script_dir))
from shared import (
box,
install_latest_pipx,
local_bin,
poetry_install_latest,
run,
spaced_hl,
)
from shared import box, install_latest_pipx, local_bin, poetry_update, run, spaced_hl
spaced_hl()
@ -33,4 +26,4 @@ run(f"{pipx_bin} upgrade-all --include-injected")
# TODO: Backup
box("Install latest Poetry packages")
poetry_install_latest(script_dir)
poetry_update(script_dir)