Skip to content

Commit

Permalink
Merge pull request #109 from openinfradev/use_git_svc_token_secret
Browse files Browse the repository at this point in the history
Git 저장소 접근 정보를 Secret을 통해 얻습니다
  • Loading branch information
ktkfree committed Feb 22, 2023
2 parents 23c6e2a + 639186b commit 1121e56
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions templates/argo-cd/create-app-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
imagePullPolicy: IfNotPresent
command:
- /bin/bash
- -c
- -cx
- |
# log into Argo CD server
./argocd login $ARGO_SERVER --plaintext --insecure --username $ARGO_USERNAME \
Expand All @@ -54,6 +54,10 @@ spec:
# check if the argocd app already exists.
./argocd app get $ARGOCD_APP_NAME
if [[ $? -ne 0 ]]; then
GIT_SVC_HTTP=${GIT_SVC_URL%://*}
GIT_SVC_BASE_URL=${GIT_SVC_URL#*//}
REPO="$GIT_SVC_HTTP://$GIT_SVC_BASE_URL/$USERNAME/$SITE_NAME-manifests"
# create new application if it doesn't exist.
./argocd app create $ARGOCD_APP_NAME --repo $REPO --revision $REVISION --path $SITE_NAME/$APP_GROUP/$PATH --dest-namespace $NAMESPACE --dest-name $TARGET_CLUSTER --project $APP_GROUP --label app=$ARGOCD_APP_LABEL --directory-recurse
fi
Expand All @@ -69,11 +73,11 @@ spec:
envFrom:
- secretRef:
name: "decapod-argocd-config"
- secretRef:
name: "git-svc-token"
env:
- name: SITE_NAME
value: "{{workflow.parameters.site_name}}"
- name: REPO
value: "{{workflow.parameters.manifest_repo_url}}"
- name: REVISION
value: "{{workflow.parameters.revision}}"
- name: APP_GROUP
Expand Down

0 comments on commit 1121e56

Please sign in to comment.