Fix tempalte

This commit is contained in:
Nikolai Rodionov 2023-02-25 21:05:01 +01:00
parent fc92125a03
commit 665f8a87c0
3 changed files with 8 additions and 5 deletions

View File

@ -373,4 +373,9 @@ And now let's create a job like that:
from_secret: ARGOCD_AUTH_TOKEN from_secret: ARGOCD_AUTH_TOKEN
commands: commands:
- argocd app sync -l app=badhouseplants -l branch=$DRONE_BRANCH - argocd app sync -l app=badhouseplants -l branch=$DRONE_BRANCH
- argocd app wait -l app=badhouseplants -l branch=$DRONE_BRANCH
``` ```
And the last step would be to remove an application when branch is removed.
> Also, I've found out that `ArgoCD` won't remove a namespace if it was created by a `SyncPolicy`, so I've added it to the helm chart, and add a new `value` to provide a name.

View File

@ -27,6 +27,3 @@ spec:
destination: destination:
server: "https://kubernetes.default.svc" server: "https://kubernetes.default.svc"
namespace: "{{ app }}-{{ name }}" namespace: "{{ app }}-{{ name }}"
syncPolicy:
syncOptions:
- CreateNamespace=true

View File

@ -3,7 +3,8 @@
branch: $ARGO_APP_BRANCH branch: $ARGO_APP_BRANCH
chart_version: $ARGO_APP_CHART_VERSION chart_version: $ARGO_APP_CHART_VERSION
value: | value: |
namespace: badhouseplants-$ARGO_APP_BRANCH namespace:
name: badhouseplants-$ARGO_APP_BRANCH
istio: istio:
hosts: hosts:
- $ARGO_APP_HOSTNAME - $ARGO_APP_HOSTNAME