runWithConfig method

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

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

Implementation

@override
Future<void> runWithConfig(
  final Configuration<BuildSecretSetCommandConfig> commandConfig,
) async {
  final projectId = commandConfig.value(
    BuildSecretSetCommandConfig.projectId,
  );
  final name = commandConfig.value(BuildSecretSetCommandConfig.name);
  final buildSecretType = commandConfig.value(
    BuildSecretSetCommandConfig.buildSecretType,
  );

  final valueToSet = commandConfig.valueOrFileContent(
    value: BuildSecretSetCommandConfig.value,
    valueFile: BuildSecretSetCommandConfig.valueFile,
  );

  await DeploymentCommands.setBuildSecret(
    runner.serviceProvider.cloudApiClient,
    logger: logger,
    projectId: projectId,
    name: name,
    value: valueToSet,
    buildSecretType: buildSecretType,
  );
}