mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-20 18:55:49 +08:00
Improve the experience of testing pull requests (#5942)
This commit is contained in:
26
extra/kuma-pr/index.mjs
Normal file
26
extra/kuma-pr/index.mjs
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
import { spawn } from "child_process";
|
||||
import { parsePrName } from "./pr-lib.mjs";
|
||||
|
||||
const prName = process.argv[2];
|
||||
|
||||
// Pre-check the prName here, so testers don't need to wait until the Docker image is pulled to see the error.
|
||||
try {
|
||||
parsePrName(prName);
|
||||
} catch (error) {
|
||||
console.error(error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
spawn("docker", [
|
||||
"run",
|
||||
"--rm",
|
||||
"-it",
|
||||
"-p", "3000:3000",
|
||||
"-p", "3001:3001",
|
||||
"--pull", "always",
|
||||
"-e", `UPTIME_KUMA_GH_REPO=${prName}`,
|
||||
"louislam/uptime-kuma:pr-test2"
|
||||
], {
|
||||
stdio: "inherit",
|
||||
});
|
Reference in New Issue
Block a user