Every branch now gets its own preview deployment
By default, a push to any branch but the production branch is built and served at an address of its own, with environment variables of its own, and production is left alone.
By default, a push to any branch but the production branch is now built and served at an address of its own, so you can open a change before it is merged. Production, its domains and its cron jobs are left alone.
| Address | What it serves |
|---|---|
https://<project>-git-<branch>.arkor.app | The branch's newest build. Its next successful build moves it. |
https://<project>-dpl-<id>.arkor.app | That one build, for as long as it is kept. |
The feature/login branch of my-app is served at my-app-git-feature-login.arkor.app. Two
branches whose names come out the same, such as feat/a and feat-a, cannot share that address:
the branch that took it first keeps it, and the other's builds are served at their own addresses.
On the Deployments page, filter by Environment to list the previews. A preview still being
served has Open this build, and the one its branch's address points to has Open this branch
as well.
A preview is built and checked as a production deployment is. It is served only at its own addresses, runs no cron jobs, and is guarded by the project's access protection as production is. Its errors are on the project's Errors page, which shows production, previews or both.
On for every project
Previews are on for every project, including the ones imported before previews existed. Each preview is a build, and its build time is billed like any other. To build the production branch alone, turn off Preview every other branch in the project's Settings › Git. A branch push is built only while both it and Deploy on push are on. See Preview deployments.
Environment variables for previews
Each variable is now read by Production, Preview or both: choose under Read by in the project's Settings › Environment variables. To give one name a value for production and another for previews, add a row for each. Variables saved before previews existed are read by production alone: tick Preview as well for a preview to have them. See Production and preview.
Your app can also read where it is running, at build time and at runtime:
| Name | Value |
|---|---|
ARKOR_ENV | production or preview |
ARKOR_URL | The deployment's own arkor.app hostname, without https://: the project's for production, and the build's -dpl- address for a preview, not its branch's |
ARKOR_GIT_COMMIT_REF | The branch the deployment was built from, or the tag or commit a manual deployment named |
ARKOR_GIT_COMMIT_SHA | The commit the deployment was built from |
If your project already has a variable of its own by one of these names, Arkor's value takes its place from the next build: rename yours.