runWithConfig method
Runs this command with prepared configuration (options). Subclasses should override this method.
Implementation
@override
Future<void> runWithConfig(
final Configuration<DeployCommandOption> commandConfig,
) async {
final projectId = commandConfig.value(DeployCommandOption.projectId);
final concurrency = commandConfig.value(DeployCommandOption.concurrency);
final dryRun = commandConfig.value(DeployCommandOption.dryRun);
final showFiles = commandConfig.value(DeployCommandOption.showFiles);
final outputPath = commandConfig.optionalValue(DeployCommandOption.output);
if (outputPath != null && !outputPath.endsWith('.zip')) {
throw FailureException(errors: ['The --output path must end with .zip']);
}
final projectDirectory = runner.verifiedProjectDirectory();
logger.debug('Using project directory `${projectDirectory.path}`');
final configFilePath =
globalConfiguration.projectConfigFile?.path ??
p.join(
projectDirectory.path,
ProjectConfigFileConstants.defaultFileName,
);
await Deploy.deploy(
runner.serviceProvider.cloudApiClient,
runner.serviceProvider.fileUploaderFactory,
logger: logger,
projectId: projectId,
projectDir: projectDirectory.path,
projectConfigFilePath: configFilePath,
concurrency: concurrency,
dryRun: dryRun,
showFiles: showFiles,
outputPath: outputPath,
);
}