Template Strings
Template Strings are strings which are dynamically replaced by Preview during a deploy, allowing you to inject environment-specific values into your deployment.
Preview supports the use of Template Strings in both for all chart values and Kubernetes manifest files under the ./preview
directory.
For example, it is recommended to use the PREVIEWHQ_HOSTNAME
as part of your application's Ingress specification:
There are 2 sets of Template Strings which can be utilized: one static set across all builds, and one set that is dynamically build based on image builds.
Static Template Strings
Template String | Description | Example |
| The hostname of the deployment, which will point to the root |
|
| The hostname of the cluster which the deployment is deployed on |
|
| The namespace which the deployment is deployed in to |
|
| The git hash being deployed | |
| The URL of the Preview-provided Docker image repository that |
Dynamic Template Strings
For each addition image specified in the images
block of the configuration, Preview injects a PREVIEWHQ_CUSTOM_IMAGE_TAG_{}
string, which is the Docker tag which was used for that custom build within the Docker image registry.
For example, if images
is as follows:
The the following additional Templates Strings are available:
PREVIEWHQ_CUSTOM_IMAGE_TAG_FRONTEND
PREVIEWHQ_CUSTOM_IMAGE_TAG_BACKEND
Last updated