Skip to content

Commit cf73ec2

Browse files
authored
Weathertop: Add --language flag to deploy.py runner. (#6967)
* Add --language flag to deploy.py runner.
1 parent 9715d48 commit cf73ec2

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-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 [targets.yaml](stacks/config/targets.yaml).
3637

3738
#### Additional Notes
3839

.tools/test/stacks/deploy.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ def deploy_resources(account_id, account_name, dir, lang="typescript"):
9898

9999

100100
def main():
101-
parser = argparse.ArgumentParser(description="admin, images, or plugin flag.")
101+
parser = argparse.ArgumentParser(description="admin, images, or plugin stack.")
102102
parser.add_argument("type", choices=["admin", "images", "plugin"])
103+
parser.add_argument("--language")
103104
args = parser.parse_args()
104105

105106
accounts = None
@@ -122,11 +123,17 @@ def main():
122123
accounts = yaml.safe_load(file)
123124
except Exception as e:
124125
print(f"Failed to read config data: \n{e}")
125-
126+
126127
if accounts is None:
127128
raise ValueError(f"Could not load accounts for stack {args.type}")
128129

129-
for account_name, account_info in accounts.items():
130+
if args.language:
131+
items = [(args.language, accounts[args.language])]
132+
else:
133+
items = accounts.items()
134+
135+
for account_name, account_info in items:
136+
130137
print(
131138
f"Reading from account {account_name} with ID {account_info['account_id']}"
132139
)

0 commit comments

Comments
 (0)