Create CET-6 90-day check-in site
This commit is contained in:
commit
5c63f9f120
109 files changed
+19290
No files matched your search
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
if [[ "${SITES_ENV_READY:-}" != "1" ]]; then
|
||||
exec "${script_dir}/sites-env.sh" -- "$0" "$@"
|
||||
fi
|
||||
|
||||
command -v timeout || {
|
||||
echo "build-verified.sh requires GNU timeout." >&2
|
||||
exit 69
|
||||
}
|
||||
|
||||
vinext="${SITES_PROJECT_ROOT}/node_modules/.bin/vinext"
|
||||
if [[ ! -x "${vinext}" ]]; then
|
||||
echo "vinext is unavailable. Run npm run install:ci and wait for it to finish before building." >&2
|
||||
exit 69
|
||||
fi
|
||||
|
||||
echo "Running bounded vinext build..."
|
||||
timeout \
|
||||
--signal=TERM \
|
||||
--kill-after="${SITES_BUILD_KILL_AFTER:-10s}" \
|
||||
"${SITES_BUILD_TIMEOUT:-3m}" \
|
||||
"${vinext}" build
|
||||
@@ -0,0 +1,16 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
export function readExecutionProfile() {
|
||||
let settings;
|
||||
try {
|
||||
settings = JSON.parse(readFileSync(new URL("../.sites-runtime/execution-profile.json", import.meta.url), "utf8"));
|
||||
} catch (error) {
|
||||
// Clean clones and remote builds have no checkout-local selection.
|
||||
if (error.code === "ENOENT") return "portable";
|
||||
throw error;
|
||||
}
|
||||
if (!["managed-linux", "portable"].includes(settings?.executionProfile)) {
|
||||
throw new Error("Invalid local execution profile; rerun the Sites plugin's configure-execution-profile.mjs.");
|
||||
}
|
||||
return settings.executionProfile;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import { spawnSync } from "node:child_process";
|
||||
import { accessSync, constants } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { projectRoot } from "./sites-env.mjs";
|
||||
import { readExecutionProfile } from "./execution-profile.mjs";
|
||||
|
||||
if (!process.env.npm_execpath) {
|
||||
throw new Error("Run this installer with npm run install:ci.");
|
||||
}
|
||||
|
||||
if (![
|
||||
"SHARP_IGNORE_GLOBAL_LIBVIPS",
|
||||
"SHARP_FORCE_GLOBAL_LIBVIPS",
|
||||
"npm_config_build_from_source",
|
||||
"NPM_CONFIG_BUILD_FROM_SOURCE",
|
||||
].some((key) => key in process.env)) {
|
||||
process.env.SHARP_IGNORE_GLOBAL_LIBVIPS = "1";
|
||||
}
|
||||
|
||||
if (readExecutionProfile() === "managed-linux") {
|
||||
const result = spawnSync("bash", [path.join(projectRoot, "scripts/install-ci.sh")], {
|
||||
stdio: "inherit",
|
||||
});
|
||||
if (result.error) throw result.error;
|
||||
process.exit(result.status ?? 1);
|
||||
}
|
||||
|
||||
// Invoke npm's JavaScript entrypoint, avoiding platform-specific shell shims.
|
||||
const installed = spawnSync(
|
||||
process.execPath,
|
||||
[
|
||||
process.env.npm_execpath, "ci", "--prefix", projectRoot, "--workspaces=false",
|
||||
"--include=dev", "--include=optional", "--prefer-offline", "--no-audit", "--no-fund",
|
||||
],
|
||||
{ stdio: "inherit" },
|
||||
);
|
||||
if (installed.error) throw installed.error;
|
||||
if (installed.status !== 0) process.exit(installed.status ?? 1);
|
||||
|
||||
try {
|
||||
accessSync(
|
||||
path.join(
|
||||
projectRoot, "node_modules", ".bin",
|
||||
process.platform === "win32" ? "vinext.cmd" : "vinext",
|
||||
),
|
||||
process.platform === "win32" ? constants.F_OK : constants.X_OK,
|
||||
);
|
||||
} catch {
|
||||
console.error("npm ci exited successfully but the local vinext executable is unavailable.");
|
||||
process.exitCode = 69;
|
||||
}
|
||||
Loaded 3 of 109 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user