Preview apps

Using policy based releases you can define policies that automatically deploy your Pull Requests or branches.

Policies for preview app deploys

The following snippet deploys app pushes on branches that match the feature/* wildcard pattern. Variables are used to guarantee unique resource names, and avoid collision.

# .gimlet/preview.yaml
app: myapp-{{ .GITHUB_BRANCH | sanitizeDNSName }}
env: staging
namespace: staging
chart:
repository: https://chart.onechart.dev
name: onechart
version: 0.28.0
deploy:
branch: feature/*
event: push
values:
replicas: 1
image:
repository: ghcr.io/podtato-head/podtatoserver
tag: "{{ .GITHUB_SHA }}"
gitRepository: laszlocph/gimletd-test-repo
gitSha: "{{ .GITHUB_SHA }}"

The next example is using the event: pr trigger to deploy Pull Requests:

# .gimlet/preview.yaml
app: myapp-{{ .GITHUB_BRANCH | sanitizeDNSName }}
env: staging
namespace: staging
chart:
repository: https://chart.onechart.dev
name: onechart
version: 0.28.0
+deploy:
+ event: pr
values:
...

For all the possibilities please refer to the Policy based releases section and to fully understand how to write a Gimlet Manifest for preview apps, check out Gimlet CLI's Preview environments with Gimlet section.