-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem
When deploying Agentuity projects, the deployment.domains configuration in agentuity.json only accepts a flat array of domain strings. All configured domains are applied to every deployment, regardless of which git branch is being deployed.
This means there's no way to associate specific custom domains with specific branches. For example, a common multi-environment setup would be:
mainbranch →app.example.com,www.example.comstagingbranch →staging.example.comdevbranch →dev.example.com
Today, users must either:
- Manually edit
agentuity.jsonbefore deploying each branch - Use separate profile files (
agentuity.staging.json) and remember to pass--profileon every deploy - Handle it in CI with custom logic to swap domains before deploying
None of these are ergonomic for the common "branch = environment" pattern.
Proposed Solution
Extend the domains property to accept either its current format (flat array, backward compatible) or a branch-keyed map:
{
"deployment": {
"domains": {
"*": ["app.example.com", "www.example.com"],
"staging": ["staging.example.com"],
"dev": ["dev.example.com"]
}
}
}Where:
*is the wildcard key matching default branches (main,master), or used when no branch is detected- Other keys are exact branch name matches
- At deploy time, the CLI resolves the map to a flat array based on the current git branch (auto-detected or via
--branchflag) - The API contract is unchanged — the server always receives a flat
string[]
CLI Support
Add a --branch flag to agentuity project add domain:
# Add domain for staging branch
agentuity project add domain staging.example.com --branch staging
# Add domain for default/main branch
agentuity project add domain app.example.com --branch "*"
# Existing flat array behavior (unchanged)
agentuity project add domain app.example.comWhen --branch is first used on a project with an existing flat domain array, the existing domains are automatically migrated to the * key.