runWithConfig method

  1. @override
Future<void> runWithConfig(
  1. Configuration<DeployCommandOption> commandConfig
)
override

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 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,
  );
}