From 53045fc58e840df9b8cdc44aa5a21c36945be338 Mon Sep 17 00:00:00 2001 From: Yoni Bettan Date: Tue, 11 Jan 2022 11:12:56 +0200 Subject: [PATCH] ci: inject local images to k3d instead of publishing them (#600) --- .github/workflows/e2e-k3s.yaml | 74 ++++++---------------------------- 1 file changed, 12 insertions(+), 62 deletions(-) diff --git a/.github/workflows/e2e-k3s.yaml b/.github/workflows/e2e-k3s.yaml index 4a2710c6e7..402d775d09 100644 --- a/.github/workflows/e2e-k3s.yaml +++ b/.github/workflows/e2e-k3s.yaml @@ -9,83 +9,33 @@ on: jobs: - image-build-and-push-query-service: + e2e-k3s: runs-on: ubuntu-latest if: ${{ github.event.label.name == 'ok-to-test' }} + env: + DOCKER_TAG: pull-${{ github.event.number }} steps: - name: Checkout code uses: actions/checkout@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - with: - version: latest - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push docker image - env: - DOCKER_TAG: pull-${{ github.event.number }} - run: make build-push-query-service - - image-build-and-push-frontend: - runs-on: ubuntu-latest - if: ${{ github.event.label.name == 'ok-to-test' }} - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Install dependencies - working-directory: frontend - run: yarn install - - name: Run Prettier - working-directory: frontend - run: npm run prettify - continue-on-error: true - - name: Run ESLint - working-directory: frontend - run: npm run lint - continue-on-error: true - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - with: - version: latest - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push docker image - env: - DOCKER_TAG: pull-${{ github.event.number }} - run: make build-push-frontend - - deploy-on-k3s-cluster: - runs-on: ubuntu-latest - if: ${{ github.event.label.name == 'ok-to-test' }} - needs: - - image-build-and-push-query-service - - image-build-and-push-frontend - steps: - - name: Checkout code - uses: actions/checkout@v2 + - name: Build query-service image + run: make build-query-service-amd64 + - name: Build frontend image + run: make build-frontend-amd64 - name: Create a k3s cluster uses: AbsaOSS/k3d-action@v2 with: - cluster-name: "test-cluster" + cluster-name: "signoz-cluster" + - name: Inject the images to the cluster + run: k3d image import signoz/query-service:$DOCKER_TAG signoz/frontend:$DOCKER_TAG -c signoz-cluster - name: Deploy the app - env: - TAG: pull-${{ github.event.number }} run: | helm dependency update deploy/kubernetes/platform helm install signoz deploy/kubernetes/platform/ -n platform --create-namespace \ --wait --timeout 10m0s \ --set cloud=null \ --set frontend.service.type=LoadBalancer \ - --set frontend.image.tag=$TAG \ - --set query-service.image.tag=$TAG + --set query-service.image.tag=$DOCKER_TAG \ + --set frontend.image.tag=$DOCKER_TAG kubectl describe deploy/signoz-frontend -n platform | grep Image kubectl describe statefulset/signoz-query-service -n platform | grep Image kubectl get pods -n platform