summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2024-02-03 17:53:24 +0100
committeralex <alex@pdp7.net>2024-02-03 17:53:24 +0100
commitcfabe8d2784383f5bd8e53602032d7b1006c094f (patch)
treeb2433cf0ce2b475452c8dfa8ecbbe016887504a1 /scripts
parent8ede99045259cfa72b5659da210836d4e47da5f4 (diff)
Add db-update command
Diffstat (limited to 'scripts')
-rw-r--r--scripts/p7s/distrobox.py15
-rw-r--r--scripts/pyproject.toml1
2 files changed, 14 insertions, 2 deletions
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)
diff --git a/scripts/pyproject.toml b/scripts/pyproject.toml
index 1480d2fe..a98507ae 100644
--- a/scripts/pyproject.toml
+++ b/scripts/pyproject.toml
@@ -20,6 +20,7 @@ ruscreen = 'p7s.ruscreen:main'
mbsync_config = 'p7s.mail:generate_config'
db-create = 'p7s.distrobox:create'
db-enter = 'p7s.distrobox:enter'
+db-update = 'p7s.distrobox:update'
nextcloud_setup = 'p7s.nextcloud:setup_nextcloud'
soju_setup = 'p7s.soju:setup_soju'
bitlbee_setup = 'p7s.bitlbee:setup_bitlbee'