Deployments
A deployment is one top-level entry underdeployments: in keel.yaml, the
way a service is one entry in a compose file. A repository can declare as
many as it needs — one per cloud, per environment, or per kind of operation:
keel.yaml
KEEL_DEPLOYMENT.
Two optional fields describe a deployment to the people using it:
description— one line of plain text on deployment cards, in lists, and at the top of generated manifests.long_description— Markdown, rendered on the deployment’s own page. Use it for what the deployment does, what it touches, and what to check afterwards.
Environments
Every deployment names a Dockerfile:awscli, gcloud, terraform, kubectl, helm, language
runtimes for your own scripts. The people deploying never install any of it.
Several deployments can share one Dockerfile, or each can have its own. Keel
builds the image at the start of every run; stable image tags keep Docker’s
layer cache effective, so a rebuild with no changes takes seconds.
The Dockerfile path and the context must be relative paths inside the
repository; ../ and absolute paths are rejected by validation.
Steps
Steps are the deployment’s procedure, in order:run is a shell script executed with /bin/sh inside the
environment container. What a step can rely on:
- The repository is mounted at
/workspace, which is the working directory. - Every active variable is exported as an environment variable, plus
KEEL_DEPLOYMENT,KEEL_TARGET,KEEL_TARGET_ID(stable across renames), andKEEL_RUN_ID. - Each step runs in its own subshell, so
cd,set -x, and other shell state do not leak into the next step. exported variables do carry forward to later steps, and to output capture at the end.- A non-zero exit fails the run. Later steps are marked skipped.
Authentication is a step
Keel has no “sign in with AWS” button, and that is deliberate: for automated deploys the right credential is a service account or an access key that the target stores as a secret variable. Write the login as the first step —aws configure set …, gcloud auth activate-service-account …,
az login --service-principal … — and the rest of the steps work as if a
person had logged in.
Keep the logic in the repository
Arun block can hold any amount of shell, but the maintainable pattern is a
short run that calls a script versioned next to the code
(./deploy/release.sh). The script can be tested outside Keel, reviewed in
pull requests, and reused by CI.
Where the repository comes from
- Keel Dev mounts the directory you ran
keel devin. Steps see your working tree, including uncommitted changes, and can write to it. - Keel Cloud makes a fresh shallow clone of the connected branch for each run and deletes it afterwards. Steps see exactly what is committed.