argo-cd/docs/user-guide/jsonnet.md
Arthur Outhenin-Chalandre 3b8ee7840b
fix: normalize libs jsonnet and broken command in docs (#4003)
* fix: jsonnet Libs normalize

Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>

* fix: jsonnet libs broken command in docs

Signed-off-by: Arthur Outhenin-Chalandre <arthur@cri.epita.fr>
2020-07-27 20:16:22 +02:00

34 lines
849 B
Markdown

# Jsonnet
Any file matching `*.jsonnet` in a directory app is treated as a Jsonnet file. ArgoCD evaluates the Jsonnet and is able to parse a generated object or array.
## Build Environment
> v1.4
Jsonnet apps have access to the [standard build environment](build-environment.md) via substitution into *TLAs* and *external variables*.
It is also possible to add a shared libary (e.g. `vendor` folder) relative to the reposity root.
E.g. via the CLI:
```bash
argocd app create APPNAME \
--jsonnet-ext-str 'app=${ARGOCD_APP_NAME}' \
--jsonnet-tla-str 'ns=${ARGOCD_APP_NAMESPACE}' \
--jsonnet-libs 'vendor'
```
Or by declarative syntax:
```yaml
directory:
jsonnet:
extVars:
- name: app
value: $ARGOCD_APP_NAME
tlas:
- name: ns
value: $ARGOCD_APP_NAMESPACE
libs:
- vendor
```