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 f103900 commit 1418050
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/argocd_plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
push:
paths:
- argocd_plugin/**
branches:
- main

jobs:
argocd_plugin:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: |
docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} &&\
docker build -t ghcr.io/cloudwebmanage/cwm-iac:argocd-plugin-${{ github.sha }} . &&\
docker push ghcr.io/cloudwebmanage/cwm-iac:argocd-plugin-${{ github.sha }} &&\
sed -i "s|image: ghcr.io/cloudwebmanage/cwm-iac:argocd-plugin-.*|image: ghcr.io/cloudwebmanage/cwm-iac:argocd-plugin-${{ github.sha }}|g" apps/argocd/patch-argocd-repo-server-deployment.yaml &&\
git config --global user.email "cwm-iac-ci@localhost" &&\
git config --global user.name "cwm-iac-ci" &&\
git add apps/argocd/patch-argocd-repo-server-deployment.yaml &&\
git commit -m "update argocd plugin image" &&\
git push
6 changes: 5 additions & 1 deletion apps/argocd/patch-argocd-repo-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ spec:
containers:
- name: uumpa
command: ["/var/run/argocd/argocd-cmp-server"]
image: ghcr.io/orihoch/uumpa-argocd-plugin/plugin:5db488b17c4346e3a43ea9736a807c81cf4074b0
image: ghcr.io/cloudwebmanage/cwm-iac:argocd-plugin-v1
env:
- name: ARGOCD_ENV_INIT_PLUGIN_FUNCTIONS
value: "cwm_worker_cluster_argocd_plugin:init"
- name: ARGOCD_ENV_GENERATE_TEMPLATE_PLUGIN_FUNCTIONS
value: "cwm_worker_cluster_argocd_plugin:generate_template"
- name: CLUSTER_NAME
value: "${CLUSTER_NAME}"
- name: CWMC_DOMAIN
Expand Down
2 changes: 2 additions & 0 deletions argocd_plugin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
FROM ghcr.io/orihoch/uumpa-argocd-plugin/plugin:1aca881ff2607d39164f5107b99e49e4935a65c6
COPY . /opt/cwm-worker-argocd-plugin
RUN pip3 install -e /opt/cwm-worker-argocd-plugin
4 changes: 4 additions & 0 deletions argocd_plugin/cwm_worker_cluster_argocd_plugin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
def init(chart_path):
pass


def generate_template(cmd, cwd, data):
return cmd, cwd

0 comments on commit 1418050

Please sign in to comment.