fetchDeploymentStatus static method

Future<Map<String, Object?>> fetchDeploymentStatus(
  1. Client cloudApiClient, {
  2. required String baseCommand,
  3. required String projectId,
  4. CommandNames commandNames = CommandNames.public,
  5. String? deploymentArg,
})

Implementation

static Future<Map<String, Object?>> fetchDeploymentStatus(
  final Client cloudApiClient, {
  required final String baseCommand,
  required final String projectId,
  final CommandNames commandNames = CommandNames.public,
  final String? deploymentArg,
}) async {
  try {
    final attemptId = await getDeployAttemptId(
      cloudApiClient,
      baseCommand: baseCommand,
      commandNames: commandNames,
      projectId: projectId,
      deploymentArg: deploymentArg,
    );
    final snapshot = await StatusCommands.fetchDeployAttemptStatus(
      cloudApiClient,
      cloudCapsuleId: projectId,
      attemptId: attemptId,
    );
    return {
      'projectId': projectId,
      'attemptId': attemptId,
      'startedAt': snapshot.startedAt,
      'stages': snapshot.stages,
    };
  } on FailureException {
    rethrow;
  } on Exception catch (e, s) {
    throw FailureException.nested(e, s, 'Failed to get deployment status');
  }
}