From a6f848de988d7d1366023b08ab4caec847d0f999 Mon Sep 17 00:00:00 2001 From: "avi@robusta.dev" Date: Thu, 10 Oct 2024 11:51:28 +0300 Subject: [PATCH 1/7] added gitops build --- .github/workflows/release.yaml | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..9f935a23 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,63 @@ +name: Release Robusta + +on: + release: + types: [published] + +env: + PROJECT_ID: ${{ secrets.GKE_PROD_PROJECT }} +jobs: + + setup-build-publish-deploy: + name: Build images + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up gcloud CLI + uses: google-github-actions/setup-gcloud@v0.2.0 + with: + service_account_key: ${{ secrets.GCP_SA_KEY }} + project_id: genuine-flight-317411 + export_default_credentials: true + + - name: Configure Docker + run: |- + gcloud auth configure-docker us-central1-docker.pkg.dev + + - name: Verify gcloud configuration + run: |- + gcloud config get-value project + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Build and push Docker images + uses: docker/build-push-action@v2 + with: + file: Dockerfile + context: . + platforms: linux/arm64,linux/amd64 + push: true + tags: us-central1-docker.pkg.dev/genuine-flight-317411/devel/kubewatch:${{ github.ref_name }} + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker images Dockerhub + uses: docker/build-push-action@v2 + with: + file: Dockerfile + context: . + platforms: linux/arm64,linux/amd64 + push: true + tags: robustadev/kubewatch:${{ github.ref_name }} + + - name: Upload helm chart + run: | + cd helm && ./upload_chart.sh + From 8e655936d6e08311e5eaa7eca53d576b83c25842 Mon Sep 17 00:00:00 2001 From: "avi@robusta.dev" Date: Thu, 10 Oct 2024 11:54:45 +0300 Subject: [PATCH 2/7] updated for testing --- .github/workflows/release.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9f935a23..f6586648 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,12 +3,15 @@ name: Release Robusta on: release: types: [published] + pull_request: + types: [opened, synchronize, reopened] env: PROJECT_ID: ${{ secrets.GKE_PROD_PROJECT }} -jobs: +jobs: setup-build-publish-deploy: + if: github.event_name == 'release' || (github.event_name == 'pull_request' && contains(github.ref_name, '-alpha')) name: Build images runs-on: ubuntu-latest @@ -57,7 +60,8 @@ jobs: push: true tags: robustadev/kubewatch:${{ github.ref_name }} + # Upload helm chart only on release, not on pull request - name: Upload helm chart + if: github.event_name == 'release' run: | cd helm && ./upload_chart.sh - From 247e959fb442ba9519c91972bebf6f8074dc8ed3 Mon Sep 17 00:00:00 2001 From: "avi@robusta.dev" Date: Thu, 10 Oct 2024 13:09:13 +0300 Subject: [PATCH 3/7] removed unused secret --- .github/workflows/release.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f6586648..defaef92 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,10 +5,7 @@ on: types: [published] pull_request: types: [opened, synchronize, reopened] - -env: - PROJECT_ID: ${{ secrets.GKE_PROD_PROJECT }} - + jobs: setup-build-publish-deploy: if: github.event_name == 'release' || (github.event_name == 'pull_request' && contains(github.ref_name, '-alpha')) From a54a29242e1e0e27d81af5477a062a574e6f3873 Mon Sep 17 00:00:00 2001 From: "avi@robusta.dev" Date: Thu, 10 Oct 2024 13:12:20 +0300 Subject: [PATCH 4/7] changing build test --- .github/workflows/release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index defaef92..bfc1e719 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,10 +5,10 @@ on: types: [published] pull_request: types: [opened, synchronize, reopened] - + jobs: setup-build-publish-deploy: - if: github.event_name == 'release' || (github.event_name == 'pull_request' && contains(github.ref_name, '-alpha')) + if: github.event_name == 'release' || (github.event_name == 'pull_request' && contains(github.head_ref, '-alpha')) name: Build images runs-on: ubuntu-latest @@ -61,4 +61,4 @@ jobs: - name: Upload helm chart if: github.event_name == 'release' run: | - cd helm && ./upload_chart.sh + cd helm && ./upload_chart.sh \ No newline at end of file From bfa3524096d76c901324e1025a70ddf2d1fcd0bd Mon Sep 17 00:00:00 2001 From: "avi@robusta.dev" Date: Thu, 10 Oct 2024 13:13:35 +0300 Subject: [PATCH 5/7] test build --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bfc1e719..372ff81a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,7 +8,7 @@ on: jobs: setup-build-publish-deploy: - if: github.event_name == 'release' || (github.event_name == 'pull_request' && contains(github.head_ref, '-alpha')) + if: github.event_name == 'release' || (github.event_name == 'pull_request') name: Build images runs-on: ubuntu-latest From 29aa546b8ee11222fc03695f4aa68f830c194fd6 Mon Sep 17 00:00:00 2001 From: "avi@robusta.dev" Date: Thu, 10 Oct 2024 13:19:37 +0300 Subject: [PATCH 6/7] updated test image tag --- .github/workflows/release.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 372ff81a..676ab0dc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,6 +6,8 @@ on: pull_request: types: [opened, synchronize, reopened] +env: + RELEASE_VER : "git-test-image" #${{ github.event.release.tag_name }} jobs: setup-build-publish-deploy: if: github.event_name == 'release' || (github.event_name == 'pull_request') @@ -40,7 +42,7 @@ jobs: context: . platforms: linux/arm64,linux/amd64 push: true - tags: us-central1-docker.pkg.dev/genuine-flight-317411/devel/kubewatch:${{ github.ref_name }} + tags: us-central1-docker.pkg.dev/genuine-flight-317411/devel/kubewatch:${{ env.RELEASE_VER }} - name: Login to Docker Hub uses: docker/login-action@v1 @@ -55,7 +57,7 @@ jobs: context: . platforms: linux/arm64,linux/amd64 push: true - tags: robustadev/kubewatch:${{ github.ref_name }} + tags: robustadev/kubewatch:${{ env.RELEASE_VER }} # Upload helm chart only on release, not on pull request - name: Upload helm chart From ea81be20010d86505322d799b81a7761817d87f0 Mon Sep 17 00:00:00 2001 From: "avi@robusta.dev" Date: Thu, 10 Oct 2024 13:58:49 +0300 Subject: [PATCH 7/7] after tests --- .github/workflows/release.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 676ab0dc..00b4593d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,14 +3,10 @@ name: Release Robusta on: release: types: [published] - pull_request: - types: [opened, synchronize, reopened] - env: - RELEASE_VER : "git-test-image" #${{ github.event.release.tag_name }} + RELEASE_VER : ${{ github.event.release.tag_name }} jobs: setup-build-publish-deploy: - if: github.event_name == 'release' || (github.event_name == 'pull_request') name: Build images runs-on: ubuntu-latest @@ -59,8 +55,6 @@ jobs: push: true tags: robustadev/kubewatch:${{ env.RELEASE_VER }} - # Upload helm chart only on release, not on pull request - name: Upload helm chart - if: github.event_name == 'release' run: | cd helm && ./upload_chart.sh \ No newline at end of file