import { deployment } from '@toa.io/operations' import { context as find } from '../util/find.js' const { Factory } = deployment /** * @param {toa.cli.deploy.Arguments} argv * @returns {Promise} */ export const deploy = async (argv) => { const path = find(argv.path) const factory = await Factory.create(path, argv.environment, { mono: argv.mono === true }) const operator = await factory.operator() if (argv.dry === true) { const options = {} if (argv.namespace !== undefined) options.namespace = argv.namespace const output = await operator.template(options) console.log(output) } else { const options = {} if (argv.namespace !== undefined) options.namespace = argv.namespace if (argv.wait === true) options.wait = true if (argv.timeout !== undefined) options.timeout = argv.timeout await operator.install(options) } }