Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,35 @@
|
||||
// Single source of truth for infra strings asserted by verify-gitea-*-workflow.mjs.
|
||||
// Forks override the defaults by exporting TOOLCTRL_* env vars in their CI environment.
|
||||
// Default values match the canonical ToolCTRL Gitea deployment so the boilerplate's own
|
||||
// CI passes without any env setup.
|
||||
|
||||
const envOr = (key, fallback) => {
|
||||
const value = process.env[key];
|
||||
if (typeof value !== "string") return fallback;
|
||||
const trimmed = value.trim();
|
||||
return trimmed ? trimmed : fallback;
|
||||
};
|
||||
|
||||
export const CI_RUNNER_LABEL = envOr("TOOLCTRL_CI_RUNNER", "toolctrl-ci");
|
||||
export const IMAGE_PREFIX = envOr("TOOLCTRL_IMAGE_PREFIX", "toolctrl");
|
||||
export const GIT_HOST = envOr("TOOLCTRL_GIT_HOST", "git.tool-ctrl.de");
|
||||
export const REGISTRY_NAMESPACE = envOr("TOOLCTRL_REGISTRY_NAMESPACE", "toolctrl-labs");
|
||||
export const DB_USER = envOr("TOOLCTRL_DB_USER", "toolctrl");
|
||||
export const DB_NAME = envOr("TOOLCTRL_DB_NAME", "toolctrl");
|
||||
export const PREFLIGHT_DATABASE_URL = `postgresql://${DB_USER}:${DB_USER}@localhost:5432/${DB_NAME}?schema=public`;
|
||||
|
||||
export function dockerImageTag(target, tag = "smoke") {
|
||||
return `${IMAGE_PREFIX}-${target}:${tag}`;
|
||||
}
|
||||
|
||||
export function escapeRegex(value) {
|
||||
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
}
|
||||
|
||||
export const HOST_OVERRIDE_WRITE_PATTERN = new RegExp(
|
||||
`printf\\s+'%s ${escapeRegex(GIT_HOST)}\\\\n'\\s+"\\$TOOLCTRL_GITEA_HOST_IP"\\s+>>\\s+/etc/hosts`,
|
||||
"g"
|
||||
);
|
||||
|
||||
export const HOST_OVERRIDE_VALIDATION_PATTERN =
|
||||
/node\s+-e\s+'process\.exit\(require\("node:net"\)\.isIP\(process\.env\.TOOLCTRL_GITEA_HOST_IP \|\| ""\) \? 0 : 1\)'/g;
|
||||
Reference in new issue
Block a user