fix: [nomad-step-5] S5-fix-4 — staging health check 404: host volume empty, needs content seeded (#1010)
All checks were successful
All checks were successful
This commit is contained in:
parent
6f21582ffa
commit
fa7fb60415
1 changed files with 17 additions and 0 deletions
17
bin/disinto
17
bin/disinto
|
|
@ -1002,6 +1002,23 @@ _disinto_init_nomad() {
|
||||||
# Deploy this service
|
# Deploy this service
|
||||||
echo ""
|
echo ""
|
||||||
echo "── Deploying ${svc} ───────────────────────────────────────"
|
echo "── Deploying ${svc} ───────────────────────────────────────"
|
||||||
|
|
||||||
|
# Seed host volumes before deployment (if needed)
|
||||||
|
case "$svc" in
|
||||||
|
staging)
|
||||||
|
# Seed site-content host volume (/srv/disinto/docker) with static content
|
||||||
|
# The staging jobspec mounts this volume read-only to /srv/site
|
||||||
|
local site_content_src="${FACTORY_ROOT}/docker/index.html"
|
||||||
|
local site_content_dst="/srv/disinto/docker"
|
||||||
|
if [ -f "$site_content_src" ] && [ -d "$site_content_dst" ]; then
|
||||||
|
if ! cmp -s "$site_content_src" "${site_content_dst}/index.html" 2>/dev/null; then
|
||||||
|
echo "[staging] seeding site-content volume..."
|
||||||
|
cp "$site_content_src" "${site_content_dst}/index.html"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
local jobspec_path="${FACTORY_ROOT}/nomad/jobs/${svc}.hcl"
|
local jobspec_path="${FACTORY_ROOT}/nomad/jobs/${svc}.hcl"
|
||||||
if [ ! -f "$jobspec_path" ]; then
|
if [ ! -f "$jobspec_path" ]; then
|
||||||
echo "Error: jobspec not found: ${jobspec_path}" >&2
|
echo "Error: jobspec not found: ${jobspec_path}" >&2
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue