Skip to content

Commit 28573a9

Browse files
committed
Add --language flag to deploy.py runner.
1 parent 4ed9b71 commit 28573a9

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.tools/test/DEPLOYMENT.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ python -m venv .venv && source .venv/bin/activate && pip install -r requirements
2525
#### Command Syntax
2626

2727
```bash
28-
python stacks/deploy.py --type <deployment_type>
28+
cd stacks ; python deploy.py <stack>
2929
```
3030

31-
Replace `<deployment_type>` with one of the supported types:
31+
Replace `<stack>` with one of the supported stacks:
3232

3333
- `admin`: Deploys admin-specific resources.
3434
- `images`: Deploys image-related resources.
3535
- `plugin`: Deploys plugin-specific resources.
36+
- To deploy only a specific language's plugin, pass `--language <language>` where language is an account in ./stacks/config/targets.yaml.
3637

3738
#### Additional Notes
3839

.tools/test/stacks/deploy.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import os
77
import yaml
88
import time
9-
import logging
109
import re
1110

1211

@@ -96,8 +95,9 @@ def deploy_resources(account_id, account_name, dir, lang="typescript"):
9695

9796

9897
def main():
99-
parser = argparse.ArgumentParser(description="admin, images, or plugin flag.")
98+
parser = argparse.ArgumentParser(description="admin, images, or plugin stack.")
10099
parser.add_argument("type", choices=["admin", "images", "plugin"])
100+
parser.add_argument("--language")
101101
args = parser.parse_args()
102102

103103
if args.type in {"admin", "images"}:
@@ -119,7 +119,12 @@ def main():
119119
except Exception as e:
120120
print(f"Failed to read config data: \n{e}")
121121

122-
for account_name, account_info in accounts.items():
122+
if args.language:
123+
items = [(args.language, accounts[args.language])]
124+
else:
125+
items = accounts.items()
126+
127+
for account_name, account_info in items:
123128
print(
124129
f"Reading from account {account_name} with ID {account_info['account_id']}"
125130
)

0 commit comments

Comments
 (0)