Join our community Discord , if you need some help.

Variable support in the Gimlet manifest

The Gimlet manifest resolves Golang templates in the gimlet manifest template step.

You provide the variable values in the --vars flag:

# .gimlet/staging.yaml
app: myapp
env: staging
namespace: my-team
name: onechart
version: 0.10.0
replicas: 1
repository: myapp
tag: "{{ .GIT_SHA }}"
tlsEnabled: true

# ci.env

gimlet manifest template \
-f .gimlet/staging.yaml \
-o manifests.yaml \
--vars ci.env

Variable resolution using GimletD

If you use GimletD for automated deploys, GimletD resolves all variables (context and custom field) that are part of the shipped artifact.

You can always look into an artifact by gimlet artifact list -o json and locate the .context and .items fields. Key value pairs from these structures are made available (case-sensitive) as variables in the Gimlet manifest.

You can also look into the artifact shipper CI plugins' source code to see how variables are added to the manifest.

gimlet artifact add \
-f artifact.json \
--field "name=CI" \
echo "Attaching environment variable context.."
VARS=$(printenv | grep GITHUB | grep -v '=$' | awk '$0="--var "$0')
gimlet artifact add -f artifact.json $VARS

and add your own variables with the gimlet artifact add command or by the CI plugins custom fields section.