Skip to content

Commit a757f0b

Browse files
committed
feat (publisher) add --keep-zip command line argument for publisher
1 parent 09fdbfd commit a757f0b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/cli/clirunner.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ program
3535
program
3636
.command('deploy')
3737
.description('deploy business logic to production')
38+
.option('--keep-zip', 'Keep generated zip file after deploying')
3839
.action(deploy);
3940

4041
program
@@ -88,7 +89,11 @@ function cloud() {
8889

8990
function deploy() {
9091
buildOptions(true)
91-
.then(CodeRunner.deploy)
92+
.then((opts) => {
93+
opts.keepZip = this.keepZip;
94+
95+
return CodeRunner.deploy(opts);
96+
})
9297
.catch(showError);
9398
}
9499

lib/server-code/publisher.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ exports.publish = function(opts) {
1515
const zipped = generateZip(model, opts.app.files.concat(dependencyPatterns()));
1616
const scs = new ServerCodeService(opts.app, opts.backendless.apiServer);
1717

18+
if (opts.keepZip) {
19+
fs.writeFile('deploy.zip', zipped);
20+
logger.info(`Deployment archive is saved to ${path.resolve('deploy.zip')}`);
21+
}
22+
1823
Promise.resolve()
1924
.then(() => scs.registerRunner()) // http://bugs.backendless.com/browse/BKNDLSS-11655
2025
.then(() => scs.registerModel(model))

0 commit comments

Comments
 (0)