Skip to content

Commit

Permalink
Merge pull request #58 from openinfradev/fix_argocd_app_label
Browse files Browse the repository at this point in the history
createapp: fix argcd app label
  • Loading branch information
seungkyua authored Sep 28, 2021
2 parents 0fb5648 + 4312e53 commit 321de43
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions templates/argo-cd/createapp-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ spec:
./argocd login $ARGO_SERVER --plaintext --insecure --username $ARGO_USERNAME \
--password $ARGO_PASSWORD
export ARGOCD_APP_NAME=$(echo "${SITE_NAME:0:8}")-$PATH
ARGOCD_APP_NAME=${SITE_NAME:0:8}-$PATH
ARGOCD_APP_LABEL=${SITE_NAME:0:8}-$APP_NAME
# check if app already exists.
./argocd app get $ARGOCD_APP_NAME
if [[ $? -ne 0 ]]; then
# create new application if not exists.
./argocd app create $ARGOCD_APP_NAME --repo $REPO --revision $REVISION --path $SITE_NAME/$APP_NAME/$PATH --dest-namespace $NAMESPACE --dest-name $SITE_NAME --project $APP_NAME --label app=$ARGOCD_APP_NAME --directory-recurse
./argocd app create $ARGOCD_APP_NAME --repo $REPO --revision $REVISION --path $SITE_NAME/$APP_NAME/$PATH --dest-namespace $NAMESPACE --dest-name $SITE_NAME --project $APP_NAME --label app=$ARGOCD_APP_LABEL --directory-recurse
fi
./argocd app set $ARGOCD_APP_NAME --sync-policy automated --auto-prune
Expand Down

0 comments on commit 321de43

Please sign in to comment.