Skip to content

Commit

Permalink
Add --language flag to deploy.py runner.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSouther committed Oct 8, 2024
1 parent 4ed9b71 commit 28573a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .tools/test/DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ python -m venv .venv && source .venv/bin/activate && pip install -r requirements
#### Command Syntax

```bash
python stacks/deploy.py --type <deployment_type>
cd stacks ; python deploy.py <stack>
```

Replace `<deployment_type>` with one of the supported types:
Replace `<stack>` with one of the supported stacks:

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

#### Additional Notes

Expand Down
11 changes: 8 additions & 3 deletions .tools/test/stacks/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import os
import yaml
import time
import logging
import re


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


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

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

for account_name, account_info in accounts.items():
if args.language:
items = [(args.language, accounts[args.language])]
else:
items = accounts.items()

for account_name, account_info in items:
print(
f"Reading from account {account_name} with ID {account_info['account_id']}"
)
Expand Down

0 comments on commit 28573a9

Please sign in to comment.