Skip to content

Commit

Permalink
re-add upload step
Browse files Browse the repository at this point in the history
  • Loading branch information
delanni committed Nov 16, 2023
1 parent 2970488 commit 2c2b3e3
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ const getPipeline = (filename: string, removeSteps = true) => {
return removeSteps ? str.replace(/^steps:/, '') : str;
};

// const uploadPipeline = (pipelineContent: string | object) => {
// const str =
// typeof pipelineContent === 'string' ? pipelineContent : JSON.stringify(pipelineContent);

// execSync('buildkite-agent pipeline upload', {
// input: str,
// stdio: ['pipe', 'inherit', 'inherit'],
// });
// };
const uploadPipeline = (pipelineContent: string | object) => {
const str =
typeof pipelineContent === 'string' ? pipelineContent : JSON.stringify(pipelineContent);

execSync('buildkite-agent pipeline upload', {
input: str,
stdio: ['pipe', 'inherit', 'inherit'],
});
};

(async () => {
try {
Expand Down Expand Up @@ -182,8 +182,7 @@ const getPipeline = (filename: string, removeSteps = true) => {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/post_build.yml'));

// remove duplicated steps
// uploadPipeline([...new Set(pipeline)].join('\n'));
console.log([...new Set(pipeline)].join('\n'));
uploadPipeline([...new Set(pipeline)].join('\n'));
} catch (ex) {
console.error('PR pipeline generation error', ex.message);
process.exit(1);
Expand Down

0 comments on commit 2c2b3e3

Please sign in to comment.