From 446ff29189d2c90d0647e8975643f2d4d3e2f03e Mon Sep 17 00:00:00 2001 From: Kirill Azovtsev Date: Sat, 22 Jun 2024 21:03:29 +0300 Subject: [PATCH] enable kagome-builder-deb workflow --- .github/workflows/build.yaml | 59 ++--------------------- .github/workflows/kagome-builder-deb.yaml | 3 ++ housekeeping/docker/kagome-dev/Makefile | 2 +- 3 files changed, 8 insertions(+), 56 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 581f7b4363..8aaa7289f9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,62 +4,11 @@ # SPDX-License-Identifier: Apache-2.0 # -name : Kagome Builder | Debian (Bookworm) +name : New Build Pipeline on: - # schedule: - # - cron: '0 2 * * 0' # Every Sunday at 2:00 AM - workflow_dispatch: - inputs: - kagome_image_rebuild: - description: 'Rebuild Kagome Builder Minideb image' - required: false - default: 'false' - type: 'boolean' - -env: - DOCKER_REGISTRY_PATH: ${{ secrets.GCP_REGISTRY }}/${{ secrets.GCP_PROJECT }}/kagome-dev/ - + workflow_dispatch: + + jobs: - build_polkadot_builder: - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name : "Authenticate with Google Cloud" - uses: 'google-github-actions/auth@v2' - with: - credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} - - - name: "Set up Cloud SDK" - uses: 'google-github-actions/setup-gcloud@v2' - - - name: "Configure Docker for GCR" - run: | - gcloud auth configure-docker --quiet - gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet - - - name: "Check if image tag exists" - id: check-tag - working-directory: ./housekeeping/docker/kagome-dev - run: | - IMAGE_TAG=$(grep '^MINIDEB_IMAGE' Makefile | awk -F '[@:]' '{print $3}' | cut -c 1-7)_rust-$(grep '^RUST_VERSION' Makefile | sed 's/.*?= //') - KAGOME_BUILDER_DEB_IMAGE=${DOCKER_REGISTRY_PATH}kagome_builder_deb:${IMAGE_TAG} - TAG_EXISTS=$(docker manifest inspect ${KAGOME_BUILDER_DEB_IMAGE} > /dev/null 2>&1 && echo "true" || echo "false") - echo "exists=$TAG_EXISTS" >> $GITHUB_ENV - echo "kagome_builder_deb=KAGOME_BUILDER_DEB_IMAGE" >> GITHUB_OUTPUT - - - name: "Build Polkadot Builder" - working-directory: ./housekeeping/docker/kagome-dev - if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true' - run: make kagome_builder_deb \ - DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} - - - name: "Push Polkadot Builder" - working-directory: ./housekeeping/docker/kagome-dev - if: env.exists == 'false' || github.event.inputs.kagome_image_rebuild == 'true' - run: make kagome_builder_deb_push \ - DOCKER_REGISTRY_PATH=${DOCKER_REGISTRY_PATH} \ No newline at end of file diff --git a/.github/workflows/kagome-builder-deb.yaml b/.github/workflows/kagome-builder-deb.yaml index 581f7b4363..b42dcc520f 100644 --- a/.github/workflows/kagome-builder-deb.yaml +++ b/.github/workflows/kagome-builder-deb.yaml @@ -7,6 +7,9 @@ name : Kagome Builder | Debian (Bookworm) on: + push: + branches: + - zombie_builder_rework # schedule: # - cron: '0 2 * * 0' # Every Sunday at 2:00 AM workflow_dispatch: diff --git a/housekeeping/docker/kagome-dev/Makefile b/housekeeping/docker/kagome-dev/Makefile index d610ce4c2d..7c5ad070c7 100644 --- a/housekeeping/docker/kagome-dev/Makefile +++ b/housekeeping/docker/kagome-dev/Makefile @@ -10,7 +10,7 @@ ARCHITECTURE ?= x86_64 DOCKER_REGISTRY_PATH ?= MINIDEB_HASH := $(subst bitnami/minideb@sha256:,,$(MINIDEB_IMAGE)) -MINIDEB_SHORT_HASH = $(shell echo $(MINIDEB_HASH) | cut -c1-7) +MINIDEB_SHORT_HASH := $(shell echo $(MINIDEB_HASH) | cut -c1-7) MINIDEB_TAG = $(MINIDEB_SHORT_HASH)_rust-$(RUST_VERSION) export DOCKER_BUILDKIT=1