Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weathertop: Add --language flag to deploy.py runner. #6967

Merged
merged 4 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 [targets.yaml](stacks/config/targets.yaml).

#### Additional Notes

Expand Down
13 changes: 10 additions & 3 deletions .tools/test/stacks/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,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()

accounts = None
Expand All @@ -122,11 +123,17 @@ def main():
accounts = yaml.safe_load(file)
except Exception as e:
print(f"Failed to read config data: \n{e}")

if accounts is None:
raise ValueError(f"Could not load accounts for stack {args.type}")

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
Loading