🔧 chore(runner): allow preset identity overrides via env
This commit is contained in:
@@ -124,9 +124,34 @@ test_preset_env_examples_exist() {
|
||||
test -f "${file}" || fail "missing env example: ${file}"
|
||||
grep -q '^GITEA_INSTANCE=https://git.mytsl.cn$' "${file}" || fail "${file} should include company default instance"
|
||||
grep -q '^GITEA_TOKEN=$' "${file}" || fail "${file} should include empty token placeholder"
|
||||
grep -q '^DEFAULT_RUNNER_NAME=' "${file}" || fail "${file} should define DEFAULT_RUNNER_NAME override example"
|
||||
grep -q '^DEFAULT_RUNNER_LABEL=' "${file}" || fail "${file} should define DEFAULT_RUNNER_LABEL override example"
|
||||
done
|
||||
}
|
||||
|
||||
test_preset_compose_supports_runner_identity_overrides() {
|
||||
grep -q 'DEFAULT_RUNNER_NAME=${DEFAULT_RUNNER_NAME:-standard-ubuntu-22}' \
|
||||
"${REPO_ROOT}/docker-runner/presets/standard-ubuntu-22/docker-compose.yml" || \
|
||||
fail "standard preset should allow DEFAULT_RUNNER_NAME override via env"
|
||||
grep -q 'DEFAULT_RUNNER_LABEL=${DEFAULT_RUNNER_LABEL:-ubuntu-22.04:host://ubuntu:22.04,company-server:host://ubuntu:22.04,standard-ubuntu-22:host://ubuntu:22.04}' \
|
||||
"${REPO_ROOT}/docker-runner/presets/standard-ubuntu-22/docker-compose.yml" || \
|
||||
fail "standard preset should allow DEFAULT_RUNNER_LABEL override via env"
|
||||
|
||||
grep -q 'DEFAULT_RUNNER_NAME=${DEFAULT_RUNNER_NAME:-buildx-ubuntu-22}' \
|
||||
"${REPO_ROOT}/docker-runner/presets/buildx-ubuntu-22/docker-compose.yml" || \
|
||||
fail "buildx ubuntu preset should allow DEFAULT_RUNNER_NAME override via env"
|
||||
grep -q 'DEFAULT_RUNNER_LABEL=${DEFAULT_RUNNER_LABEL:-ubuntu-22.04:host://ubuntu:22.04,company-server:host://ubuntu:22.04,buildx-ubuntu-22:host://ubuntu:22.04}' \
|
||||
"${REPO_ROOT}/docker-runner/presets/buildx-ubuntu-22/docker-compose.yml" || \
|
||||
fail "buildx ubuntu preset should allow DEFAULT_RUNNER_LABEL override via env"
|
||||
|
||||
grep -q 'DEFAULT_RUNNER_NAME=${DEFAULT_RUNNER_NAME:-buildx-archlinux}' \
|
||||
"${REPO_ROOT}/docker-runner/presets/buildx-archlinux/docker-compose.yml" || \
|
||||
fail "buildx arch preset should allow DEFAULT_RUNNER_NAME override via env"
|
||||
grep -q 'DEFAULT_RUNNER_LABEL=${DEFAULT_RUNNER_LABEL:-archlinux:host://archlinux:latest,company-server:host://archlinux:latest,buildx-archlinux:host://archlinux:latest}' \
|
||||
"${REPO_ROOT}/docker-runner/presets/buildx-archlinux/docker-compose.yml" || \
|
||||
fail "buildx arch preset should allow DEFAULT_RUNNER_LABEL override via env"
|
||||
}
|
||||
|
||||
test_preset_compose_uses_env_for_instance
|
||||
test_workflows_do_not_hardcode_company_server
|
||||
test_stats_workflow_uses_workflow_secret_consistently
|
||||
@@ -138,5 +163,6 @@ test_readme_has_project_intro_and_navigation
|
||||
test_deployment_doc_stays_runner_focused
|
||||
test_presets_define_expected_hostname
|
||||
test_preset_env_examples_exist
|
||||
test_preset_compose_supports_runner_identity_overrides
|
||||
|
||||
echo "template_defaults_test.sh: PASS"
|
||||
|
||||
Reference in New Issue
Block a user