[buildkite] Add more logging and debug information to PR pipeline generation (#100709)

This commit is contained in:
Brian Seeders 2023-10-11 14:11:27 -04:00 committed by GitHub
parent 731c253058
commit 81a441e636
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 182 additions and 149 deletions

View file

@ -6,13 +6,19 @@ import { generatePipelines } from "./pipeline";
const pipelines = generatePipelines();
for (const pipeline of pipelines) {
if (!process.env.CI) {
// Just for local debugging purposes
const yaml = stringify(pipeline.pipeline);
console.log(`--- Generated pipeline: ${pipeline.name}`);
console.log(yaml);
// Only do the pipeline upload if we're actually in CI
// This lets us run the tool locally and see the output
if (process.env.CI) {
console.log("");
console.log(stringify(pipeline));
} else {
console.log("Uploading pipeline...");
execSync(`buildkite-agent pipeline upload`, {
input: stringify(pipeline),
input: yaml,
stdio: ["pipe", "inherit", "inherit"],
});
}