@puls-atlas/cli
Version:
The Puls Atlas CLI tool for managing Atlas projects
18 lines • 2.21 kB
JavaScript
import handlers from './index.js';
import hooks from '../../hooks/index.js';
import { configureServiceDeployCommand } from './serviceCommand.js';
const registerDeployCommands = (program, {
withEnvironmentOptions
}, dependencies = {}) => {
const commandHandlers = dependencies.handlers ?? handlers;
const commandHooks = dependencies.hooks ?? hooks;
const deploy = program.command('deploy').description('Deploy commands.').alias('d');
withEnvironmentOptions(configureServiceDeployCommand(deploy.command('service <serviceName>'), (serviceName, commandOptions) => commandHandlers.service.deploy(serviceName, commandOptions))).hook('preAction', commandHooks.versionCheck);
deploy.command('functions [functionSelectors...]').description('Deploy one or more Firebase functions to Google Cloud. ' + 'Accepts <function>, <codebase>:<function>, or functions:<codebase>:<function>.').option('--interactive', 'Select functions to deploy from the chosen codebase export list.').option('--editor', 'Provide bare function names from your editor, one per line, for the chosen codebase.').option('--codebase <nameOrPath>', 'Default Cloud Functions codebase name or source path for unqualified function names.').action(commandHandlers.functions).hook('preAction', commandHooks.npmAuth).hook('preAction', commandHooks.versionCheck);
deploy.command('app').description('Create a GitHub release that triggers the production Cloud Build/App Engine deploy.').action(commandHandlers.app).hook('preAction', commandHooks.versionCheck);
deploy.command('cron').description('Deploy cron jobs to Google Cloud.').action(commandHandlers.cron).hook('preAction', commandHooks.versionCheck);
deploy.command('rules').description('Deploy Firestore rules to the selected consumer project.').option('--firestore', 'Deploy Firestore rules (default).').option('--storage', 'Storage rules are not currently supported.').action(commandHandlers.rules).hook('preAction', commandHooks.versionCheck);
deploy.command('indexes').description('Deploy Firestore indexes to the selected consumer project.').action(commandHandlers.indexes).hook('preAction', commandHooks.versionCheck);
return deploy;
};
export default registerDeployCommands;