strip docker type — site-publish is static-content only
Removes type: docker handling from action.yaml, scripts (build/deploy/utils/setup), and templates (deployment.yaml.j2, service-docker.yaml.j2). Renamed service-static.yaml.j2 -> service.yaml.j2. If site.yaml has type: docker, parse_site_yaml() now dies with a clear message pointing to action/image-build + action/image-push + action/image-deploy with hand-authored apps-repo manifests. rainsounds.vino.network was the only docker consumer and has already migrated. Drops registry-password input from action.yaml (no longer needed).
This commit is contained in:
+3
-36
@@ -1,12 +1,11 @@
|
||||
"""Build phase — content prep (static) or docker image build."""
|
||||
"""Build phase — content prep for static-content sites."""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
from utils import EXCLUDE_FILES, die, env, parse_site_yaml, run
|
||||
from utils import EXCLUDE_FILES, env, parse_site_yaml, run
|
||||
|
||||
|
||||
def build_static(site_dir, cfg):
|
||||
@@ -55,35 +54,6 @@ def build_static(site_dir, cfg):
|
||||
print(f"Build complete — content at {html_dir}")
|
||||
|
||||
|
||||
def docker_login():
|
||||
password = os.environ.get("REGISTRY_PASSWORD", "")
|
||||
user = env("CI_BOT_USER", "ci-bot")
|
||||
if not password:
|
||||
die("REGISTRY_PASSWORD is required for docker builds")
|
||||
subprocess.run(
|
||||
f"echo '{password}' | docker login code.fritzlab.net -u {user} --password-stdin",
|
||||
shell=True, check=True,
|
||||
)
|
||||
|
||||
|
||||
def build_docker(site_dir, cfg):
|
||||
docker_login()
|
||||
image = cfg["image"]
|
||||
run_number = env("GITHUB_RUN_NUMBER", "0")
|
||||
tags = [f"{image}:latest", f"{image}:{run_number}"]
|
||||
|
||||
cmd_parts = ["docker", "build"]
|
||||
for tag in tags:
|
||||
cmd_parts += ["-t", tag]
|
||||
cmd_parts += ["--network", "host", "--provenance=false"]
|
||||
for key, val in cfg.get("build_args", {}).items():
|
||||
cmd_parts += ["--build-arg", f"{key}={val}"]
|
||||
cmd_parts.append(str(site_dir))
|
||||
|
||||
run(" ".join(cmd_parts))
|
||||
print(f"Docker build complete — tags: {', '.join(tags)}")
|
||||
|
||||
|
||||
def cmd_build():
|
||||
site_dir = Path(env("SITE_DIR"))
|
||||
cfg = parse_site_yaml(site_dir)
|
||||
@@ -92,7 +62,4 @@ def cmd_build():
|
||||
print("Site disabled — skipping build")
|
||||
return
|
||||
|
||||
if cfg["type"] == "docker":
|
||||
build_docker(site_dir, cfg)
|
||||
else:
|
||||
build_static(site_dir, cfg)
|
||||
build_static(site_dir, cfg)
|
||||
|
||||
Reference in New Issue
Block a user