Template Variables
Use Environment, Service, and configuration values in Lifecycle Service settings.
Overview
Lifecycle uses Mustache to render templates.
Available Template Variables
You can use these template variables in your configuration. A Service-specific variable starts with the Service name.
General Variables
{{{buildUUID}}}- The unique Environment identifier, for example,lively-down-881123.{{{buildSHA}}}- The Lifecycle-generated build revision for the Environment.{{{namespace}}}- The deployment namespace, for example,env-lively-down-881123.{{{pullRequestNumber}}}- The GitHub pull request number, when the Environment has one.{{{branchName}}}- The source branch name.{{{repoName}}}- The full source repository name, such asorg/repo.
Service-Specific Variables
For a Service-specific variable, replace <service_name> with the Service name.
-
{{{<service_name>_branchName}}}- The branch name for the Service deployment. -
{{{<service_name>_dockerImage}}}- The fully qualified Docker image reference for the Service. -
{{{<service_name>_initDockerImage}}}- The fully qualified image reference for the Service init container. -
{{{<service_name>_internalHostname}}}- The internal hostname of the deployed Service. For an optional Service that is not deployed, the value isdefaultInternalHostname.Lifecycle replaces
service_internalHostnamewith a cluster domain name such asservice.namespace.svc.cluster.local. This name supports deployments across namespaces. -
{{{<service_name>_ipAddress}}}- The service IP address. -
{{{<service_name>_namespace}}}- The Kubernetes namespace that the Service uses. -
{{{<service_name>_publicUrl}}}- The public URL of the deployed Service. For an optional Service that is not deployed, the value isservices.defaultPublicUrl. -
{{{<service_name>_sha}}}- Theshavalue of the Service deploy. -
{{{<service_name>_UUID}}}- The build UUID of the Service. For a Service inoptionalServicesordefaultServices, the value depends on its selection:- If selected, it is equal to
buildUUID. - If not selected, Lifecycle uses the Service override for
defaultUUID. - If the Service has no override, Lifecycle uses the installation default.
- If selected, it is equal to
When a Service uses deployment.network.hostPortMapping, Lifecycle also
creates {{{<host>-<service_name>_publicUrl}}} variables for the mapped hosts.
Configuration Data
Lifecycle makes each key in an active
configuration Service available as a template
variable. A data entry named FEATURE_MODE becomes
{{{FEATURE_MODE}}}. The configuration Service name is not a prefix.
Example
Lifecycle renders the frontend values from the current Environment and backend Service before creating the workload.
Undefined variables render as an empty string. For a raw URL or image name,
use triple braces ({{{ }}}). Make sure that Service names match.
See the Mustache.js documentation.