From 8a56040351b96ba20329a38ff5c6c2c746655cc2 Mon Sep 17 00:00:00 2001 From: Holash Chand Date: Sat, 17 Aug 2024 10:31:18 +0530 Subject: [PATCH] temp 3 --- .github/workflows/maven.yml | 39 +++++++------------------- services/metrics/Makefile | 2 +- services/notification-service/Makefile | 2 +- 3 files changed, 12 insertions(+), 31 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 55f15d1bc..2514b1c3b 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -58,34 +58,16 @@ jobs: run: | df -h docker image ls - build-go: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Docker Compose - run: | - curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - chmod +x /usr/local/bin/docker-compose - docker-compose --version - docker system df - - name: Login to Docker Registry - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build Go Services - run: make build-go - - name: Publish build artifacts - run: make publish-builds - - name: Check space after tests - run: | - df -h - docker image ls - docker system df - build-node: + build-services: strategy: matrix: include: + - os: ubuntu-latest + name: notification-service + platform: linux/amd64 + - os: ubuntu-latest + name: metrics + platform: linux/amd64 - os: ubuntu-latest name: identity-service platform: linux/amd64 @@ -120,9 +102,9 @@ jobs: uses: actions/cache@v4 with: path: /tmp/docker-layer-cache - key: ${{ runner.os }}-docker-cache-node-${{ matrix.name }} + key: ${{ runner.os }}-docker-cache-${{ matrix.name }} restore-keys: | - ${{ runner.os }}-docker-cache-node-${{ matrix.name }} + ${{ runner.os }}-docker-cache-${{ matrix.name }} - name: Build Node Services env: CACHE_SRC: type=local,src=/tmp/docker-layer-cache @@ -140,8 +122,7 @@ jobs: test-builds-2: needs: - build-java - - build-go - - build-node + - build-services strategy: matrix: include: diff --git a/services/metrics/Makefile b/services/metrics/Makefile index 443969747..a497d8692 100644 --- a/services/metrics/Makefile +++ b/services/metrics/Makefile @@ -27,6 +27,6 @@ build: metrics-server @echo $(source) docker: - @docker build -t $(IMAGE) . + @docker buildx build --platform=$$PLATFORM --cache-from=$$CACHE_SRC --cache-to=$$CACHE_DST -t $(IMAGE) . publish: @docker push $(IMAGE) \ No newline at end of file diff --git a/services/notification-service/Makefile b/services/notification-service/Makefile index 2c1c45c06..437dbf3cb 100644 --- a/services/notification-service/Makefile +++ b/services/notification-service/Makefile @@ -41,4 +41,4 @@ run: ./notification-service ./notification-service --scheme http --port 8765 docker: - docker build -t local/sunbird-rc-notification-service . + docker buildx build --platform=$$PLATFORM --cache-from=$$CACHE_SRC --cache-to=$$CACHE_DST -t local/sunbird-rc-notification-service .