Skip to content

Commit

Permalink
chore(infra): add arg to specify category (#5180)
Browse files Browse the repository at this point in the history
  • Loading branch information
Equartey authored Jul 19, 2024
1 parent 46d9ad2 commit 76f4039
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions infra-gen2/tool/deploy_gen2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const pathToBackends = 'infra-gen2/backends';
void main(List<String> arguments) async {
final args = _parseArgs(arguments);
final verbose = args.flag('verbose');
final categoryToDeploy = args['category'];

final bucketNames = <String>[];

Expand All @@ -64,6 +65,10 @@ void main(List<String> arguments) async {

print('🚀 Deploying Gen 2 backends!');
for (final backendGroup in infraConfig) {
if (categoryToDeploy != null &&
backendGroup.category.name != categoryToDeploy) {
continue;
}
// TODO(equartey): Could be removed when all backends are defined.
if (backendGroup.backends.isEmpty) {
continue;
Expand Down Expand Up @@ -172,6 +177,13 @@ ArgResults _parseArgs(List<String> args) {
abbr: 'v',
help: 'Run command in verbose mode',
defaultsTo: false,
)
..addOption(
'category',
abbr: 'c',
help: 'Specify the category to deploy.',
allowed: Category.values.map((e) => e.name).toList(),
defaultsTo: null,
);

return parser.parse(args);
Expand Down

0 comments on commit 76f4039

Please sign in to comment.