Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions bin/pos-cli-deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ program
.option('-o --old-assets-upload', 'use old assets upload strategy')
.option('-p --partial-deploy', 'Partial deployment, does not remove data from directories missing from the build')
.option('--dry-run', 'Validate the release on the server without applying any changes')
.option('-v, --verbose', 'Show full file paths in deploy report (default: summary only)')
.action(async (environment, params) => {
if (params.force) logger.Warn('-f flag is deprecated and does not do anything.');

if (params.dryRun && !process.env.DEV) {
logger.Warn('--dry-run is temporarily disabled. This feature will be enabled soon.');
await logger.Warn('--dry-run is temporarily disabled. This feature will be enabled soon.');
process.exit(0);
}

Expand All @@ -39,7 +40,8 @@ program
CI: process.env.CI === 'true',
// TODO: Get rid off global system env, make it normal argument to function.
PARTIAL_DEPLOY: !!params.partialDeploy,
DIRECT_ASSETS_UPLOAD: !params.oldAssetsUpload
DIRECT_ASSETS_UPLOAD: !params.oldAssetsUpload,
VERBOSE: !!params.verbose
});

deployStrategy.run({ strategy, opts: { env, authData, params } });
Expand Down
16 changes: 9 additions & 7 deletions lib/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let gateway;

const toCount = (val) => Array.isArray(val) ? val.length : (typeof val === 'number' ? val : 0);

const printDeployReport = (deployReport) => {
const printDeployReport = (deployReport, { verbose = false } = {}) => {
if (!deployReport) return;

const lines = [];
Expand All @@ -27,11 +27,13 @@ const printDeployReport = (deployReport) => {
];
lines.push(` ${category}: ${parts.join(', ')}`);

if (Array.isArray(upserted)) {
upserted.forEach(p => lines.push(` + ${p}`));
}
if (Array.isArray(deleted)) {
deleted.forEach(p => lines.push(chalk.red(` - ${p}`)));
if (verbose) {
if (Array.isArray(upserted)) {
upserted.forEach(p => lines.push(` + ${p}`));
}
if (Array.isArray(deleted)) {
deleted.forEach(p => lines.push(chalk.red(` - ${p}`)));
}
}
}

Expand Down Expand Up @@ -100,7 +102,7 @@ const push = async env => {
.then(getDeploymentStatus)
.then((response) => {
logger.Debug('Release deployed');
printDeployReport(response.report);
printDeployReport(response.report, { verbose: env.VERBOSE === true || env.VERBOSE === 'true' });
if (response.warning) {
logger.Warn(response.warning);
}
Expand Down