Skip to content

Commit

Permalink
feat: dry flag to output build commands
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Nov 2, 2023
1 parent d33576a commit a53403a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions buildTestImages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import { imageNameForProposalTest, readProposals } from './common';

const options = {
match: { short: 'm', type: 'string' },
dry: { type: 'boolean' },
};
const { values } = parseArgs({ options });

const { match } = values;
const { match, dry } = values;

const allProposals = readProposals();

Expand All @@ -19,10 +20,14 @@ const proposals = match
: allProposals;

for (const proposal of proposals) {
console.log(`\nBuilding test image for proposal ${proposal.proposalName}`);
if (!dry) {
console.log(`\nBuilding test image for proposal ${proposal.proposalName}`);
}
const { name, target } = imageNameForProposalTest(proposal);
const cmd = `docker build --tag ${name} --target ${target} .`;
console.log(cmd);
// TODO stream the output
execSync(cmd);
if (!dry) {
// TODO stream the output
execSync(cmd);
}
}

0 comments on commit a53403a

Please sign in to comment.