runWithConfig method

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

Runs this command with prepared configuration (options). Subclasses should override this method.

Implementation

@override
Future<void> runWithConfig(
    final Configuration<DeploymentsShowOption> commandConfig) async {
  final projectId = commandConfig.value(DeploymentsShowOption.projectId);
  final inUtc = commandConfig.value(DeploymentsShowOption.utc);
  final deploymentArg =
      commandConfig.optionalValue(DeploymentsShowOption.deploy);
  final overallStatus =
      commandConfig.value(DeploymentsShowOption.overallStatus);

  try {
    final attemptId = await _getDeployAttemptId(
      runner.serviceProvider.cloudApiClient,
      projectId,
      deploymentArg,
    );

    await StatusCommands.showDeploymentStatus(
      runner.serviceProvider.cloudApiClient,
      logger: logger,
      cloudCapsuleId: projectId,
      attemptId: attemptId,
      inUtc: inUtc,
      outputOverallStatus: overallStatus,
    );
  } on Exception catch (e, s) {
    throw FailureException.nested(e, s, 'Failed to get deployment status');
  }
}