Profiles
Keep variants of harthelm.yml as profiles and pick one when you Sync.
A profile is a complete variant of your landscape in a file of its own, for example a small development landscape
in harthelm.yml and a production-like one with more replicas in harthelm.prod.yml. You pick the profile when you
Sync.
| File | Profile |
|---|---|
harthelm.yml | the default |
harthelm.<profile>.yml | <profile>: lower-case letters, digits and dashes, at most 32 characters |
A profile has no inheritance: there is no extends:, and each file is complete on its own.
Create a profile
- Open Landscape config on the rail.
- Next to Profile, click Add profile, or Duplicate profile to start from the one you are editing.
- Type the name, for example
prod, and choose Start from: an empty landscape or a copy of an existing profile. Click Create profile.
schema: harthelm/v1
prepare:
- run: npm ci --omit=dev
- run: npm run build
services:
web:
type: steps
plan: small
replicas: 2
availability: always
steps: [{run: npm start}]
ports:
- port: 3000
routes: [{path: /}]Sync a profile
Pick the profile in the Profile selector at the top of the Run panel, then click Sync.
The landscape remembers the profile of its last Sync, and Run always uses that one: hart run takes no profile.
The Run panel shows "Deployed from …" under the selector.
Selecting another profile changes nothing until you Sync. Until then the Run panel says "The landscape is deployed
from …, but … is selected". Prepare and test read the selected profile's file; without -p, hart prepare,
hart test and hart sync use the selected one too.
When to use profiles
- Different sizes: small plans and sleeping services in development, more replicas and services that never sleep for a demo.
- Different services: a mock of an external API in one profile, a
forwardservice to the real one in another. - Different prepare steps: a dev install with all dependencies, a production build without them.
Variables that differ only in value are often simpler as workspace env vars read
with ${{ env.K }} in one file.