Skip to content

Commit

Permalink
Fix GCP Marketplace workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Sheehy <[email protected]>
  • Loading branch information
steven-sheehy committed Oct 1, 2023
1 parent c148816 commit 5a16fdb
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 75 deletions.
153 changes: 78 additions & 75 deletions .github/workflows/release-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,86 +3,87 @@ name: Release Production
on:
push:
tags: [ v* ]
branches: [ "6961-marketplace-fails" ]

jobs:
image:
strategy:
matrix:
module: [ graphql, grpc, importer, monitor, rest, rest-java, rest-monitor, rosetta, test, web3 ]
env:
CONTEXT: hedera-mirror-${{ matrix.module }}
IMAGE: gcr.io/mirrornode/hedera-mirror-${{ matrix.module }}
name: Publish images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get tag
run: echo "TAG=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV

- name: Custom monitor path
if: matrix.module == 'rest-monitor'
run: echo "CONTEXT=hedera-mirror-rest/monitoring" >> $GITHUB_ENV

- name: Install JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
with:
credentials_json: '${{ secrets.GCR_KEY }}'

- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v1

- name: Configure Docker
run: gcloud auth configure-docker gcr.io,marketplace.gcr.io

- name: Build
uses: gradle/gradle-build-action@v2
if: matrix.module != 'rest' && matrix.module != 'rest-monitor' && matrix.module != 'rosetta'
with:
arguments: build -x test

- name: Setup QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push images
uses: docker/build-push-action@v5
with:
build-args: VERSION=${{env.TAG}}
cache-from: type=gha
cache-to: type=gha,mode=max
context: ${{env.CONTEXT}}
platforms: linux/amd64, linux/arm64
provenance: false
push: true
tags: ${{env.IMAGE}}:${{env.TAG}},${{env.IMAGE}}:latest

chart:
name: Publish charts
needs: image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Publish helm chart
uses: stefanprodan/[email protected]
with:
target_dir: charts
token: ${{ secrets.GITHUB_TOKEN }}
# image:
# strategy:
# matrix:
# module: [ graphql, grpc, importer, monitor, rest, rest-java, rest-monitor, rosetta, test, web3 ]
# env:
# CONTEXT: hedera-mirror-${{ matrix.module }}
# IMAGE: gcr.io/mirrornode/hedera-mirror-${{ matrix.module }}
# name: Publish images
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
#
# - name: Get tag
# run: echo "TAG=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
#
# - name: Custom monitor path
# if: matrix.module == 'rest-monitor'
# run: echo "CONTEXT=hedera-mirror-rest/monitoring" >> $GITHUB_ENV
#
# - name: Install JDK
# uses: actions/setup-java@v3
# with:
# distribution: 'temurin'
# java-version: 17
#
# - name: Authenticate to Google Cloud
# uses: google-github-actions/auth@v1
# with:
# credentials_json: '${{ secrets.GCR_KEY }}'
#
# - name: Setup gcloud
# uses: google-github-actions/setup-gcloud@v1
#
# - name: Configure Docker
# run: gcloud auth configure-docker gcr.io,marketplace.gcr.io
#
# - name: Build
# uses: gradle/gradle-build-action@v2
# if: matrix.module != 'rest' && matrix.module != 'rest-monitor' && matrix.module != 'rosetta'
# with:
# arguments: build -x test
#
# - name: Setup QEMU
# uses: docker/setup-qemu-action@v3
#
# - name: Setup Docker Buildx
# uses: docker/setup-buildx-action@v3
#
# - name: Build and push images
# uses: docker/build-push-action@v5
# with:
# build-args: VERSION=${{env.TAG}}
# cache-from: type=gha
# cache-to: type=gha,mode=max
# context: ${{env.CONTEXT}}
# platforms: linux/amd64, linux/arm64
# provenance: false
# push: true
# tags: ${{env.IMAGE}}:${{env.TAG}},${{env.IMAGE}}:latest
#
# chart:
# name: Publish charts
# needs: image
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Publish helm chart
# uses: stefanprodan/[email protected]
# with:
# target_dir: charts
# token: ${{ secrets.GITHUB_TOKEN }}

marketplace:
name: GCP Marketplace release
needs: chart
if: "!contains(github.ref, '-')"
#if: "!contains(github.ref, '-')"
permissions:
id-token: write
contents: read
Expand All @@ -92,7 +93,9 @@ jobs:
MPDEV: "/home/runner/mpdev"
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@
with:
ref: tags/v0.89.0

- name: Authenticate to Google Cloud
id: google-auth
Expand Down
6 changes: 6 additions & 0 deletions charts/marketplace/gcp/schema-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ properties:
importer.config.hedera.mirror.importer.network:
default: "DEMO"
type: string
importer.resources.requests.cpu:
default: "200m"
type: string
importer.resources.requests.memory:
default: "512Mi"
type: string
rest.service.type:
default: ClusterIP
type: string

0 comments on commit 5a16fdb

Please sign in to comment.