build: restart the owpengram-server@/owpengram-admin@ systemd instances
The services are now templated by instance name rather than plain units, so build.sh needs to restart owpengram-server@ghj209a.service and owpengram-admin@ghj209a.service instead. Added an INSTANCE override to match the existing IMAGE/POD pattern.
This commit is contained in:
parent
9b76ef4041
commit
2bc87ea594
1 changed files with 8 additions and 6 deletions
14
build.sh
14
build.sh
|
|
@ -1,20 +1,22 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Build the owpengram-server container image (stamping the current git state into
|
# Build the owpengram-server container image (stamping the current git state into
|
||||||
# the binary - .containerignore excludes .git, so go build can't see the repo and
|
# the binary - .containerignore excludes .git, so go build can't see the repo and
|
||||||
# the values are passed in here), then restart the owpengram-server and
|
# the values are passed in here), then restart the owpengram-server@ and
|
||||||
# owpengram-admin systemd services so they pick up the freshly built image.
|
# owpengram-admin@ systemd template service instances so they pick up the
|
||||||
# Container creation/lifecycle beyond the pod itself is owned by those systemd
|
# freshly built image. Container creation/lifecycle beyond the pod itself is
|
||||||
# units, not this script.
|
# owned by those systemd units, not this script.
|
||||||
#
|
#
|
||||||
# Usage: ./build.sh [extra podman build args...]
|
# Usage: ./build.sh [extra podman build args...]
|
||||||
# IMAGE=my/tag ./build.sh override the image tag (default: owpengram-server)
|
# IMAGE=my/tag ./build.sh override the image tag (default: owpengram-server)
|
||||||
# POD=name ./build.sh override the pod name (default: owpengram)
|
# POD=name ./build.sh override the pod name (default: owpengram)
|
||||||
|
# INSTANCE=name ./build.sh override the systemd instance name (default: ghj209a)
|
||||||
# NO_DEPLOY=1 ./build.sh build the image only, don't restart the services
|
# NO_DEPLOY=1 ./build.sh build the image only, don't restart the services
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
IMAGE="${IMAGE:-owpengram-server}"
|
IMAGE="${IMAGE:-owpengram-server}"
|
||||||
POD="${POD:-owpengram}"
|
POD="${POD:-owpengram}"
|
||||||
|
INSTANCE="${INSTANCE:-ghj209a}"
|
||||||
|
|
||||||
podman build \
|
podman build \
|
||||||
--build-arg GIT_COMMIT="$(git rev-parse HEAD)" \
|
--build-arg GIT_COMMIT="$(git rev-parse HEAD)" \
|
||||||
|
|
@ -43,5 +45,5 @@ if ! podman pod exists "$POD"; then
|
||||||
-p 12500-12999:12500-12999/udp
|
-p 12500-12999:12500-12999/udp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
systemctl restart owpengram-server.service owpengram-admin.service
|
systemctl restart "owpengram-server@${INSTANCE}.service" "owpengram-admin@${INSTANCE}.service"
|
||||||
systemctl --no-pager status owpengram-server.service owpengram-admin.service
|
systemctl --no-pager status "owpengram-server@${INSTANCE}.service" "owpengram-admin@${INSTANCE}.service"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue