From cfabe8d2784383f5bd8e53602032d7b1006c094f Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 3 Feb 2024 17:53:24 +0100 Subject: Add db-update command --- scripts/p7s/distrobox.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'scripts/p7s/distrobox.py') diff --git a/scripts/p7s/distrobox.py b/scripts/p7s/distrobox.py index 45e11a6f..2e4e5cee 100644 --- a/scripts/p7s/distrobox.py +++ b/scripts/p7s/distrobox.py @@ -2,9 +2,20 @@ import os import subprocess +IMAGE="quay.io/alexpdp7/workstation:latest" +NAME="workstation-latest" + + def create(): - subprocess.run(["distrobox", "create", "-i", "quay.io/alexpdp7/workstation:latest"], check=True) + subprocess.run(["distrobox", "create", "-i", IMAGE], check=True) def enter(): - os.execvp("distrobox", ["distrobox", "enter", "workstation-latest"]) + os.execvp("distrobox", ["distrobox", "enter", NAME]) + + +def update(): + subprocess.run(["distrobox", "rm", "-f", NAME], check=True) + subprocess.run(["podman", "rmi", IMAGE], check=True) + subprocess.run(["podman", "pull", IMAGE], check=True) + subprocess.run(["distrobox", "create", "-i", IMAGE], check=True) -- cgit v1.2.3