Ship-step contract for pipelines: uniform exit codes (0/1/2/3/4/7) in cli/lib/ship-step.ts, one final --json line, --result-file (atomic, also on failure), --progress json, --env-file with secret redaction, --version-from; idempotent play upload / apple upload / play release / apple submit re-runs end with exit 7; play upload takes --track production and --version-code
This commit is contained in:
parent
4eac8e8cd8
commit
06a0b424f5
14 changed files with 928 additions and 24 deletions
|
|
@ -104,6 +104,9 @@ export const RESULT_MARK = '\u001estorebound-result ';
|
|||
* `storebound serve` (STOREBOUND_MACHINE=1) it is one marked line, so log lines printed before it never break parsing.
|
||||
*/
|
||||
export function printJson(data: unknown): void {
|
||||
// a ship step (cli/lib/ship-step.ts) keeps the data for its one final line instead of printing it
|
||||
const ship = (globalThis as unknown as Record<symbol, { detail?: unknown } | null | undefined>)[Symbol.for('storebound.shipRun')];
|
||||
if (ship) { ship.detail = data; return; }
|
||||
if (process.env.STOREBOUND_MACHINE === '1') process.stdout.write(RESULT_MARK + JSON.stringify(data) + '\n');
|
||||
// during a --json run console.log goes to stderr, so the JSON goes to stdout itself
|
||||
else if (jsonOutput()) process.stdout.write(JSON.stringify(data, null, 2) + '\n');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue