How do you pass Argo CD build environment values into manifests?
AdvancedConceptHelm, Kustomize & Multiple Sources
Answer
Argo CD exposes build environment variables to Helm, Kustomize and plugins, such as ARGOCD_APP_NAME, ARGOCD_APP_NAMESPACE, ARGOCD_APP_REVISION, ARGOCD_APP_REVISION_SHORT, ARGOCD_APP_SOURCE_REPO_URL and ARGOCD_APP_SOURCE_PATH. In Helm you use them via parameters:
helm:
parameters:
- name: gitCommit
value: $ARGOCD_APP_REVISION
They are useful for labelling resources with the deployed commit.
More on Helm, Kustomize & Multiple Sources
How does Argo CD deploy a Helm chart?BeginnerWhat are the consequences of Argo CD using `helm template` rather than `helm install`?IntermediateWhat are the ways to provide Helm values in an Application?BeginnerHow do you deploy a chart from an OCI registry?IntermediateHow does Argo CD deploy Kustomize, and what overrides can the Application set?BeginnerWhat are multiple sources, and what is the `$values` reference?Intermediate