Skip to content

Commit

Permalink
enhance(templates): add deployment parameter details (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockopp committed Dec 13, 2022
1 parent 5908fb6 commit e58dd41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions content/templates/tutorials/go/vars_platform.md
Expand Up @@ -19,10 +19,11 @@ Platform variables can be referenced with the following syntax:

## Examples

- `{{ vela "VELA_FULL_REPO_NAME" }}` equates to the `VELA_FULL_REPO_NAME` environment variable
- `{{ vela "FULL_REPO_NAME" }}` equates to the `VELA_REPO_NAME` environment variable
- `{{ vela "VELA_REPO_NAME" }}` equates to the `VELA_REPO_NAME` environment variable
- `{{ vela "REPO_NAME" }}` equates to the `VELA_REPO_NAME` environment variable
- `{{ vela "VELA_BUILD_NUMBER" }}` equates to the `VELA_BUILD_NUMBER` environment variable
- `{{ vela "VELA_ADDR" }}` equates to the `VELA_ADDR` environment variable
- `{{ vela "DEPLOYMENT_PARAMETER_<name>" }}` equates to the `DEPLOYMENT_PARAMETER_<name>` environment variable

## Sample

Expand All @@ -46,6 +47,7 @@ The caller of this template could look like:

```yaml
version: "1"

templates:
- name: sample
source: github.com/<org>/<repo>/path/to/file/<template>.yml
Expand All @@ -61,6 +63,7 @@ Which means the compiled pipeline for execution on a worker is:

```yaml
version: "1"

steps:
- name: sample_echo
commands:
Expand Down
4 changes: 3 additions & 1 deletion content/templates/tutorials/starlark/vars_platform.md
Expand Up @@ -7,6 +7,8 @@ description: >

{{% alert color="note" %}}
We recommend reviewing [Starlark Spec](https://github.com/bazelbuild/starlark/blob/master/spec.md) before attempting to create a template.

Additionally, depending on how the template is written, it may be incompatible with viewing pipelines in the UI.
{{% /alert %}}

## Overview
Expand All @@ -20,6 +22,7 @@ Platform variables can be referenced with the following syntax:
- `ctx["vela"]["repo"]["name"]` equates to the `VELA_REPO_NAME` environment variable
- `ctx["vela"]["build"]["number"]` equates to the `VELA_BUILD_NUMBER` environment variable
- `ctx["vela"]["system"]["addr"]` equates to the `VELA_ADDR` environment variable
- `ctx["vela"]["deployment"]["<name>"]` equates to the `DEPLOYMENT_PARAMETER_<name>` environment variable

## Sample

Expand Down Expand Up @@ -58,7 +61,6 @@ steps:
- name: build
template:
name: sample
vars:
```

Which means the compiled pipeline for execution on a worker is:
Expand Down

0 comments on commit e58dd41

Please sign in to comment.