Skip to content

Commit 76f4039

Browse files
authored
chore(infra): add arg to specify category (#5180)
1 parent 46d9ad2 commit 76f4039

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

infra-gen2/tool/deploy_gen2.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const pathToBackends = 'infra-gen2/backends';
5656
void main(List<String> arguments) async {
5757
final args = _parseArgs(arguments);
5858
final verbose = args.flag('verbose');
59+
final categoryToDeploy = args['category'];
5960

6061
final bucketNames = <String>[];
6162

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

6566
print('🚀 Deploying Gen 2 backends!');
6667
for (final backendGroup in infraConfig) {
68+
if (categoryToDeploy != null &&
69+
backendGroup.category.name != categoryToDeploy) {
70+
continue;
71+
}
6772
// TODO(equartey): Could be removed when all backends are defined.
6873
if (backendGroup.backends.isEmpty) {
6974
continue;
@@ -172,6 +177,13 @@ ArgResults _parseArgs(List<String> args) {
172177
abbr: 'v',
173178
help: 'Run command in verbose mode',
174179
defaultsTo: false,
180+
)
181+
..addOption(
182+
'category',
183+
abbr: 'c',
184+
help: 'Specify the category to deploy.',
185+
allowed: Category.values.map((e) => e.name).toList(),
186+
defaultsTo: null,
175187
);
176188

177189
return parser.parse(args);

0 commit comments

Comments
 (0)