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:
4 files changed
+6
-6
No files matched your search
@@ -13,7 +13,7 @@ on:
|
||||
env:
|
||||
REGISTRY: git.plabble.org
|
||||
# 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 }}
|
||||
PUSH: ${{ github.event_name != 'pull_request' }}
|
||||
|
||||
|
||||
@@ -60,16 +60,17 @@ main() {
|
||||
else
|
||||
die "no container name specified"
|
||||
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.
|
||||
if [[ -z "$(podman ps -q -f name="^$name$" -f status=running)" ]] || (($# > 0)); then
|
||||
log "starting $image..."
|
||||
log "starting $name:$tag..."
|
||||
|
||||
default_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
|
||||
|
||||
exec podman exec --detach-keys "ctrl-@,ctrl-@" -it "$name" ${DEVC_COMMAND:-bash -l}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
ARG TAG=main
|
||||
FROM git.plabble.org/job79/base:${TAG}
|
||||
@@ -1,2 +1,3 @@
|
||||
#!/bin/bash
|
||||
image=base
|
||||
run_opts+=("-v" "$HOME/Code/infra:/home/user/Code/infra")
|
||||
Reference in new issue
Block a user