Skip to content

allez provision

Create and configure one branch workspace per sub-folder, named [<repo>]-[<branch-slug>]-[<sub-folder>]. <repo> is branch-workspace.git.repository. The slug is the branch name with each run of non-alphanumeric characters replaced by a single - (feature/foo_bar → feature-foo-bar). The workspace is created empty.

Usage

allez provision [OPTIONS] [PATH]

Arguments

Argument Description
PATH Solution root (fabric/) or a single workspace sub-folder. Default: .

Options

Option Description
--env, -e <str> The environment key used to resolve allez.yml for the branch workspaces: feature. An environment that config.yml maps to a named environment's workspace is refused. Required.
--branch, -b <str> Branch to provision branch workspaces for. Default: the current one. Pass it on a CI agent, which checks out a detached HEAD.
--plan Preview every fab call without creating or changing anything.

Examples

allez provision fabric --env feature --plan              # every fab call a run would make, nothing created
allez provision fabric --env feature                     # what the provision pipeline runs on a branch

What a run does

For each sub-folder:

  1. Create the workspace, on the capacity that allez.yml branch-workspace declares for --env, with fab mkdir -P capacityName=…. Skipped if the workspace exists; then, if it sits on another capacity, it is moved with fab assign .capacities/<capacity>.Capacity -W <name>.Workspace (branch-workspace).
  2. Configure from the same block: description, settings (fab set), roles (fab acl set), workspace identity, then the domain (fab api …/assignToDomain, by id) and the tags (fab api …/applyTags, one call for the tags not already there). --plan prints the block as resolved for --env, then these calls (branch-workspace).

Then fill the workspaces with allez deploy --env feature --branch-workspace --commit-to-git, not by updating from git (why).

Behaviour

  • Safe to re-run. Each step checks the current state first, so a run can be repeated after a failure. A re-run reports what it skipped and applies the config again.
  • Every sub-folder, given the root. One workspace each, whether or not the branch changes that sub-folder. A PATH naming one sub-folder limits a run to it.
  • Refused for named environments and protected branches. An --env that config.yml maps to a named workspace (dev, test, prod) is refused, as is a protected branch, before any fab call.
  • Domains and tags only warn. One Fabric refuses is reported and provisioning continues (tenant setup).
  • A role needs an id. A roles: entry without an id: beside its principal: is reported and skipped (roles).