Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions scripts/deploy-mta.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -579,22 +579,28 @@ async function main() {
// the operator can verify before swapping traffic and retiring blue. Resume
// with `cf deploy -i <OP_ID> -a resume`; abort with `-a abort`.
const strategyFlags = bg ? ['--strategy', args.strategy] : [];
// Upload app/resource bits concurrently instead of serially. Pure I/O win,
// no behavioral change — with ~5 modules (srv, srv-qa, approuter, two HDI
// deployers) this trims the stdout-buffered upload/stage long pole.
const uploadFlags = ['--parallel-resource-upload'];
// Upload each mtar's file chunks in parallel rather than sequentially — a
// per-chunk I/O win driven by the MULTIAPPS_UPLOAD_CHUNKS_SEQUENTIALLY env var
// (from `cf deploy` help: "Upload chunks sequentially instead of in parallel.
// By default is false"). Setting it explicitly documents intent; false is
// already the plugin default, so behavior is unchanged. NOTE: the MultiApps
// CLI plugin has NO per-module upload-parallelism flag — the previously-used
// `--parallel-resource-upload` flag never existed and made `cf deploy` reject
// the whole invocation ("Unknown or wrong flags"), breaking every scripted
// deploy; this env var is the real supported mechanism.
const cfDeployEnv = { ...process.env, MULTIAPPS_UPLOAD_CHUNKS_SEQUENTIALLY: 'false' };
step(4, `cf deploy (-e ${mtaext})` + (bg ? ` --strategy ${args.strategy} [pauses before swap]` : ''));
if (args.dryRun) {
const preview = newestMtarPath() || 'mta_archives/<newest>.mtar';
warn(`dry-run: would run \`cf deploy ${preview} -e ${mtaext} ${uploadFlags.join(' ')} ${strategyFlags.join(' ')} -f\` in .deploy/`);
warn(`dry-run: would run \`MULTIAPPS_UPLOAD_CHUNKS_SEQUENTIALLY=false cf deploy ${preview} -e ${mtaext} ${strategyFlags.join(' ')} -f\` in .deploy/`);
if (bg) warn('dry-run: blue-green would then PAUSE for verification before the traffic swap.');
} else {
// Pass the explicit newest mtar, NOT the `mta_archives/*.mtar` glob:
// Windows git-bash does not expand it and cf.exe panics (issue #1226).
const mtar = newestMtarPath();
if (!mtar) die(1, `no .mtar found in ${path.relative(ROOT, MTAR_GLOB_DIR)} to deploy. Run without --skip-build, or build the mtar first.`);
await notifyDeploy('start', cfg, { env: envName, version: deployVersion });
const code = sh('cf', ['deploy', mtar, '-e', mtaext, ...uploadFlags, ...strategyFlags, '-f'], { cwd: DEPLOY_DIR });
const code = sh('cf', ['deploy', mtar, '-e', mtaext, ...strategyFlags, '-f'], { cwd: DEPLOY_DIR, env: cfDeployEnv });
if (code !== 0) {
if (bg) abortFailedBlueGreen();
await notifyDeploy('fail', cfg, { env: envName, version: deployVersion, detail: 'cf deploy failed' });
Expand Down
Loading