Deploy
Preview environments
Push a feature branch and get a full copy of the environment it came from, with its own URLs and databases. Merge it and the copy stops, then goes away a week later.
Turn them on
Project settings → Preview settings. Previews are off by default.
Create previews automatically
Turn the setting on.
List the branches
Names and patterns, such as
feat/*andfix/*. There is no "every branch" default.Pick a fallback environment
Usually
dev. Used when pherwerz can't tell which environment a branch came from.
From then on, pushing a matching branch creates a preview named after it:
feat/login becomes feat-login.
Branch patterns
Patterns match the whole branch name, in order, and the last match wins.
| Pattern | Matches |
|---|---|
feat/* | feat/login, not feat/login/v2 |
feat/** | feat/login and feat/login/v2 |
!feat/experiment-* | Excludes those, when listed after feat/* |
hotfix | Exactly that name |
What gets copied
A preview copies the environment of the branch it was created from:
feat/login branched off dev copies dev.
| Copied | Not copied |
|---|---|
| Every service, with its source, commands, port and size | Custom domains: each service gets a new URL |
| Variables, with the overrides from preview settings | Deployment history and logs |
| Database references, pointed at the copy's own database | What's in databases and buckets, unless you choose starting data |
| Cron jobs, with their schedule paused | Backups |
On GitHub
Each commit gets a check, pherwerz-cloud / <environment>, and each pull
request gets one comment, edited in place, listing the preview's services
and their URLs. Previews come from branches, not pull requests; a pull
request from a fork gets nothing.
Merge, stop, delete
| When | What happens |
|---|---|
| The pull request is merged | The preview is stopped |
| 7 days later | It is deleted, with its data |
| The branch is pushed again first | It starts again; the delete is cancelled |
| You press Make permanent | It becomes a permanent environment |
Each of these is a project setting. Permanent environments are never stopped or deleted by any of it.