refactor: run infra as a profile on the base image

The infra image was identical to base. config.sh can now set image= to
reuse another image, so infra no longer needs to be built and pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Job79andClaude Opus 5.5 committed 2026-11-08 11:46:59 +01:00
1 parent 4d657656cd
commit 410e6e6410
4 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ on:
env: env:
REGISTRY: git.plabble.org REGISTRY: git.plabble.org
# Images in build order; later images build FROM the local base image. # Images in build order; later images build FROM the local base image.
IMAGES: base go infra IMAGES: base go
TAG: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || github.ref_name }} TAG: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || github.ref_name }}
PUSH: ${{ github.event_name != 'pull_request' }} PUSH: ${{ github.event_name != 'pull_request' }}
+4 -3
View File
@@ -60,16 +60,17 @@ main() {
else else
die "no container name specified" die "no container name specified"
fi fi
local name="${image%:*}" local name="${image%:*}" tag="${image#*:}"
image="$name" # config.sh may override (e.g. image=base).
# Start/Restart if not running or if arguments change configuration. # Start/Restart if not running or if arguments change configuration.
if [[ -z "$(podman ps -q -f name="^$name$" -f status=running)" ]] || (($# > 0)); then if [[ -z "$(podman ps -q -f name="^$name$" -f status=running)" ]] || (($# > 0)); then
log "starting $image..." log "starting $name:$tag..."
default_args default_args
param_args "$@" param_args "$@"
podman run --replace --stop-timeout 0 -td "${run_opts[@]}" "${DEVC_REGISTRY:-git.plabble.org/job79}/$image" podman run --replace --stop-timeout 0 -td "${run_opts[@]}" "${DEVC_REGISTRY:-git.plabble.org/job79}/$image:$tag"
fi fi
exec podman exec --detach-keys "ctrl-@,ctrl-@" -it "$name" ${DEVC_COMMAND:-bash -l} exec podman exec --detach-keys "ctrl-@,ctrl-@" -it "$name" ${DEVC_COMMAND:-bash -l}
-2
View File
@@ -1,2 +0,0 @@
ARG TAG=main
FROM git.plabble.org/job79/base:${TAG}
+1
View File
@@ -1,2 +1,3 @@
#!/bin/bash #!/bin/bash
image=base
run_opts+=("-v" "$HOME/Code/infra:/home/user/Code/infra") run_opts+=("-v" "$HOME/Code/infra:/home/user/Code/infra")