argo-cd/docs/user-guide/jsonnet.md
Matthias Riegler e930de1228
Feat: (Jsonnet) Add support to include library paths (#3825)
* feat: added Libs field to ApplicationSourceJsonnet

Signed-off-by: Matthias Riegler <matthias.riegler@taotesting.com>

* feat: codegen

Signed-off-by: Matthias Riegler <matthias.riegler@taotesting.com>

* feat: implemented jsonnet jpath arguments

- Implement the `-J` command line flag for jsonnet
- adapt test to include a nested library for testing the VM
  functionality

Signed-off-by: Matthias Riegler <matthias.riegler@taotesting.com>

* feat: jsonnet import path relative to the repoRoot

- adapted testCase to make use of a jpath
- join repoRoot and provided jpath attributes

Signed-off-by: Matthias Riegler <matthias.riegler@taotesting.com>

* fix: added checking for out-of-repoRoot references

Signed-off-by: Matthias Riegler <matthias.riegler@taotesting.com>

* feat: Added CLI option for passing jsonnet libs

Signed-off-by: Matthias Riegler <matthias.riegler@taotesting.com>

* feat: Updated jsonnet docs

Signed-off-by: Matthias Riegler <matthias.riegler@taotesting.com>

* fix: renamed function

Signed-off-by: Matthias Riegler <matthias.riegler@taotesting.com>

* feat: Expose --local-repo-root flag

Allows passing a "virtal" git repository root when using the local sync
mode with --local.
Provides backwardscompatible with the previous default value ("/")

Signed-off-by: Matthias Riegler <matthias.riegler@taotesting.com>

* fix: added missing command

Signed-off-by: Matthias Riegler <matthias.riegler@taotesting.com>

* Remove obsolete line out of docs

Signed-off-by: Matthias Riegler <matthias.riegler@taotesting.com>
2020-07-13 23:18:21 +02:00

847 B

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 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:

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:

  directory:
    jsonnet:
      extVars:
      - name: app
        value: $ARGOCD_APP_NAME
      tlas:
        - name: ns
          value: $ARGOCD_APP_NAMESPACE
      libs:
        - vendor