File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,18 @@ ifneq ("$(wildcard $(UUID_FILE))","")
2828 UUID_HELM_OPTS := --set main.analyticsUUID=$(UUID)
2929endif
3030
31- HELM_OPTS =-f values-global.yaml --set main.git.repoURL="$(TARGET_REPO ) " --set main.git.revision=$(TARGET_BRANCH ) $(TARGET_SITE_OPT ) $(UUID_HELM_OPTS ) $(EXTRA_HELM_OPTS )
31+ # Set the secret name *and* its namespace when deploying from private repositories
32+ # The format of said secret is documented here: https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#repositories
33+ TOKEN_SECRET ?=
34+ TOKEN_NAMESPACE ?=
35+
36+ ifeq ($(TOKEN_SECRET ) ,)
37+ HELM_OPTS =-f values-global.yaml --set main.git.repoURL="$(TARGET_REPO ) " --set main.git.revision=$(TARGET_BRANCH ) $(TARGET_SITE_OPT ) $(UUID_HELM_OPTS ) $(EXTRA_HELM_OPTS )
38+ else
39+ # When we are working with a private repository we do not escape the git URL as it might be using an ssh secret which does not use https://
40+ TARGET_CLEAN_REPO =$(shell git ls-remote --get-url --symref $(TARGET_ORIGIN ) )
41+ HELM_OPTS =-f values-global.yaml --set main.tokenSecret=$(TOKEN_SECRET ) --set main.tokenSecretNamespace=$(TOKEN_NAMESPACE ) --set main.git.repoURL="$(TARGET_CLEAN_REPO ) " --set main.git.revision=$(TARGET_BRANCH ) $(TARGET_SITE_OPT ) $(UUID_HELM_OPTS ) $(EXTRA_HELM_OPTS )
42+ endif
3243
3344
3445# #@ Pattern Common Tasks
You can’t perform that action at this time.
0 commit comments