UNPKG

@c8y/toolkit

Version:

Toolkit for Cumulocity applications, allows to e.g. deploy an application to an instance of Cumulocity.

33 lines 1.97 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.registerDeployCommand = registerDeployCommand; const deploy_1 = require("../utils/deploy"); const constants_1 = require("../constants"); const client_1 = require("@c8y/client"); const helpers_1 = require("../utils/helpers"); function registerDeployCommand(program) { program .command('deploy') .description('Deploy application to Cumulocity') .argument('<zipFile>', 'Path to zip file') .requiredOption('-u, --url <URL>', constants_1.OPTIONS_CONSTANTS['TXT.URL'], (0, helpers_1.getFromEnvVar)('C8Y_URL')) .requiredOption('-U, --user <user>', constants_1.OPTIONS_CONSTANTS['TXT.USERNAME'], (0, helpers_1.getFromEnvVar)('C8Y_USER')) .requiredOption('-P, --password <password>', constants_1.OPTIONS_CONSTANTS['TXT.PASSWORD'], (0, helpers_1.getFromEnvVar)('C8Y_PASSWORD')) .option('-t, --tenant <tenant>', constants_1.OPTIONS_CONSTANTS['TXT.TENANT'], (0, helpers_1.getFromEnvVar)('C8Y_TENANT')) .option('--tags <tags>', 'Comma separated list of tags to apply to the uploaded version') .option('--rolling-tags', 'Will remove tags that are already in use by previous version and adds them to the newly uploaded version') .option('--add-web-sdk-stable-tag', 'Add web SDK stable tag') .option('--delete-existing-tags', 'Delete existing tags') .option('-a --availability <availability>', `Availability of the application, either: "${client_1.ApplicationAvailability.PRIVATE}", "${client_1.ApplicationAvailability.MARKET}" or "${client_1.ApplicationAvailability.SHARED}"`) .action(async (zipPath, options) => { try { await (0, deploy_1.deployZipFile)(zipPath, options); } catch (e) { console.error('Failed to deploy application'); console.error(e); throw e; } }); } //# sourceMappingURL=deploy.js.map