Skip to content

Commit

Permalink
add argocd plugin implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
OriHoch committed Jan 27, 2024
1 parent 464189b commit 6762191
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
21 changes: 21 additions & 0 deletions apps/argocd-apps/templates/app-cwm-worker-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cwm-worker-ingress
spec:
destination:
namespace: cwm-worker-ingress
server: 'https://kubernetes.default.svc'
project: cwm
syncPolicy:
syncOptions:
- CreateNamespace=true
source:
repoURL: git@github.com:CloudWebManage/cwm-worker-ingress.git
targetRevision: main
path: helm
plugin:
name: uumpa
env:
- name: CWM_APP
value: cwm-worker-ingress
14 changes: 14 additions & 0 deletions apps/argocd-apps/templates/project-cwm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: cwm
spec:
destinations:
- name: '*'
namespace: '*'
server: https://kubernetes.default.svc
sourceRepos:
- git@github.com:CloudWebManage/cwm-worker-ingress.git
clusterResourceWhitelist:
- group: '*'
kind: '*'
3 changes: 2 additions & 1 deletion argocd_plugin/cwm_worker_cluster_argocd_plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def add_cluster_values(cwm_app, cluster_name, path):
def generate_template(cmd, cwd, data):
cwm_app = os.environ.get('ARGOCD_ENV_CWM_APP')
cluster_name = os.environ.get('CLUSTER_NAME')
cmd += add_cluster_values(cwm_app, cluster_name, cwd)
if cwm_app and cluster_name:
cmd += add_cluster_values(cwm_app, cluster_name, cwd)
return cmd, cwd


Expand Down

0 comments on commit 6762191

Please # to comment.