From b2fdc0da59797387e9e683f5e3fcc4e78f720802 Mon Sep 17 00:00:00 2001 From: miko-ov Date: Fri, 15 Dec 2023 10:40:44 +0800 Subject: [PATCH] adjust workflow, and apply fix to argocd --- .github/workflows/demo1.yaml | 63 ++----------------- .../.helmignore | 0 .../Chart.yaml | 0 .../templates/deployment.yaml | 0 .../templates/hpa.yaml | 0 .../templates/ingress.yaml | 0 .../templates/pvc.yaml | 0 .../templates/role.yaml | 0 .../templates/rolebinding.yaml | 0 .../templates/service.yaml | 0 .../templates/serviceaccount.yaml | 0 .../values.yaml | 0 12 files changed, 6 insertions(+), 57 deletions(-) rename chart/{pixelaw-core-demo1 => pixelaw-core}/.helmignore (100%) rename chart/{pixelaw-core-demo1 => pixelaw-core}/Chart.yaml (100%) rename chart/{pixelaw-core-demo1 => pixelaw-core}/templates/deployment.yaml (100%) rename chart/{pixelaw-core-demo1 => pixelaw-core}/templates/hpa.yaml (100%) rename chart/{pixelaw-core-demo1 => pixelaw-core}/templates/ingress.yaml (100%) rename chart/{pixelaw-core-demo1 => pixelaw-core}/templates/pvc.yaml (100%) rename chart/{pixelaw-core-demo1 => pixelaw-core}/templates/role.yaml (100%) rename chart/{pixelaw-core-demo1 => pixelaw-core}/templates/rolebinding.yaml (100%) rename chart/{pixelaw-core-demo1 => pixelaw-core}/templates/service.yaml (100%) rename chart/{pixelaw-core-demo1 => pixelaw-core}/templates/serviceaccount.yaml (100%) rename chart/{pixelaw-core-demo1 => pixelaw-core}/values.yaml (100%) diff --git a/.github/workflows/demo1.yaml b/.github/workflows/demo1.yaml index 05bb00b..3856d7e 100644 --- a/.github/workflows/demo1.yaml +++ b/.github/workflows/demo1.yaml @@ -29,61 +29,11 @@ jobs: - name: Lint Helm Chart run: | - helm lint --values ./chart/pixelaw-core-demo1/values.yaml ./chart/pixelaw-core-demo1 + helm lint --values ./chart/pixelaw-core/values.yaml ./chart/pixelaw-core - helmRelease: - needs: [helmTest] - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Get latest release - id: get-latest-release - uses: actions/github-script@v3 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const release = await github.repos.getLatestRelease({ - owner: context.repo.owner, - repo: context.repo.repo - }); - return release.data.tag_name; - - - name: Set ENV variable - run: echo "VERSION=${{ steps.get-latest-release.outputs.result }}" >> $GITHUB_ENV - - - name: Configure Git - run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - - name: Install Helm - uses: azure/setup-helm@v1 - with: - version: v3.8.1 - - - name: custom packaging - run: | - rm -rf .cr-release-packages - mkdir -p .cr-release-packages - helm package chart/$PROJECTNAME-demo1 --app-version=${VERSION:1} --version=${VERSION:1} --destination=.cr-release-packages - - - name: Run chart-releaser - # switch back to helm/chart-releaser-action if this contribution is ever mergedd - uses: askcloudarchitech/chart-releaser-action@skip-packaging-option - with: - skip_packaging: true - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" deploy: - needs: [helmRelease] + needs: [helmTest] runs-on: ubuntu-latest steps: - name: Checkout code @@ -118,10 +68,9 @@ jobs: ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_AUTH_TOKEN }} run: | argocd app create $PROJECTNAME-demo1 \ - --repo https://pixelaw.github.io/core/ \ + --repo https://github.com/pixelaw/core.git \ --path chart/ \ - --revision ${VERSION:1} \ - --helm-chart $PROJECTNAME \ + --revision demo1 \ --dest-namespace $PROJECTNAME-demo1 \ --dest-server https://kubernetes.default.svc \ --helm-set-string dockerImage=$REGISTRY/$PROJECTNAME:${VERSION} \ @@ -129,5 +78,5 @@ jobs: --server $ARGOCD_SERVER \ --auth-token $ARGOCD_AUTH_TOKEN - argocd app sync pixelaw-core - argocd app wait pixelaw-core \ No newline at end of file + argocd app sync $PROJECTNAME-demo1 + argocd app wait $PROJECTNAME-demo1 diff --git a/chart/pixelaw-core-demo1/.helmignore b/chart/pixelaw-core/.helmignore similarity index 100% rename from chart/pixelaw-core-demo1/.helmignore rename to chart/pixelaw-core/.helmignore diff --git a/chart/pixelaw-core-demo1/Chart.yaml b/chart/pixelaw-core/Chart.yaml similarity index 100% rename from chart/pixelaw-core-demo1/Chart.yaml rename to chart/pixelaw-core/Chart.yaml diff --git a/chart/pixelaw-core-demo1/templates/deployment.yaml b/chart/pixelaw-core/templates/deployment.yaml similarity index 100% rename from chart/pixelaw-core-demo1/templates/deployment.yaml rename to chart/pixelaw-core/templates/deployment.yaml diff --git a/chart/pixelaw-core-demo1/templates/hpa.yaml b/chart/pixelaw-core/templates/hpa.yaml similarity index 100% rename from chart/pixelaw-core-demo1/templates/hpa.yaml rename to chart/pixelaw-core/templates/hpa.yaml diff --git a/chart/pixelaw-core-demo1/templates/ingress.yaml b/chart/pixelaw-core/templates/ingress.yaml similarity index 100% rename from chart/pixelaw-core-demo1/templates/ingress.yaml rename to chart/pixelaw-core/templates/ingress.yaml diff --git a/chart/pixelaw-core-demo1/templates/pvc.yaml b/chart/pixelaw-core/templates/pvc.yaml similarity index 100% rename from chart/pixelaw-core-demo1/templates/pvc.yaml rename to chart/pixelaw-core/templates/pvc.yaml diff --git a/chart/pixelaw-core-demo1/templates/role.yaml b/chart/pixelaw-core/templates/role.yaml similarity index 100% rename from chart/pixelaw-core-demo1/templates/role.yaml rename to chart/pixelaw-core/templates/role.yaml diff --git a/chart/pixelaw-core-demo1/templates/rolebinding.yaml b/chart/pixelaw-core/templates/rolebinding.yaml similarity index 100% rename from chart/pixelaw-core-demo1/templates/rolebinding.yaml rename to chart/pixelaw-core/templates/rolebinding.yaml diff --git a/chart/pixelaw-core-demo1/templates/service.yaml b/chart/pixelaw-core/templates/service.yaml similarity index 100% rename from chart/pixelaw-core-demo1/templates/service.yaml rename to chart/pixelaw-core/templates/service.yaml diff --git a/chart/pixelaw-core-demo1/templates/serviceaccount.yaml b/chart/pixelaw-core/templates/serviceaccount.yaml similarity index 100% rename from chart/pixelaw-core-demo1/templates/serviceaccount.yaml rename to chart/pixelaw-core/templates/serviceaccount.yaml diff --git a/chart/pixelaw-core-demo1/values.yaml b/chart/pixelaw-core/values.yaml similarity index 100% rename from chart/pixelaw-core-demo1/values.yaml rename to chart/pixelaw-core/values.yaml