Skip to content

update embedded mcd to 6.0 (#46) #63

update embedded mcd to 6.0 (#46)

update embedded mcd to 6.0 (#46) #63

name: build and deploy staging
env:
DOCKERHUB_ORG: mobilecoin
REPO_NAME: reserve-auditor
TARGET_CLUSTER: utility-r1-d-k8s
CHART_REPO: https://harbor.mobilecoin.com/chartrepo/mobilecoinfoundation-public
CHART_PATH: ./.internal-ci/charts/reserve-auditor
on:
push:
tags:
- 'v*.*.*'
jobs:
frontend:
name: build-frontend
runs-on: mco-dev-large-x64
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0
- name: Docker
uses: mobilecoinofficial/gh-actions/docker@v0
with:
dockerfile: .internal-ci/docker/Dockerfile.frontend
images: mobilecoin/reserve-auditor-frontend
flavor: latest=true
tags: |
type=ref,event=branch
type=semver,pattern=v{{version}}
type=sha
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
backend:
strategy:
matrix:
versions:
- {mobilecoind: v6.0.1-test, prefix: testnet, network: test}
- {mobilecoind: v6.0.1, prefix: mainnet, network: prod}
name: Build-backend
runs-on: mco-dev-large-x64
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0
- name: Docker
uses: mobilecoinofficial/gh-actions/docker@v0
with:
dockerfile: Dockerfile
images: mobilecoin/reserve-auditor
build_args: |
MOBILECOIND_BASE_TAG=${{ matrix.versions.mobilecoind }}
NETWORK=${{ matrix.versions.network }}
flavor: latest=true
tags: |
type=ref,event=branch
type=semver,pattern=v{{version}},suffix=-${{ matrix.versions.prefix }}
type=sha
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
harbor:
needs: backend
name: Publish to Harbor
runs-on: mco-dev-small-x64
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0
- name: Package and publish chart
uses: mobilecoinofficial/gha-k8s-toolbox@v1
with:
action: helm-publish
chart_repo_username: ${{ secrets.HARBOR_USERNAME }}
chart_repo_password: ${{ secrets.HARBOR_PASSWORD }}
chart_repo: ${{ env.CHART_REPO }}
chart_app_version: ${{ github.ref_name }}
chart_version: ${{ github.ref_name }}
chart_path: ${{ env.CHART_PATH }}
deploy:
name: Deploy
runs-on: mco-dev-small-x64
needs: [backend,harbor]
strategy:
matrix:
target:
- {chain: main, network: main-stage}
- {chain: test, network: test-stage}
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0
- name: Create reserve-auditor-staging namespace
uses: mobilecoinofficial/gha-k8s-toolbox@v1
with:
action: namespace-create
namespace: reserve-auditor-staging
rancher_cluster: ${{ env.TARGET_CLUSTER }}
rancher_url: ${{ secrets.RANCHER_B_URL }}
rancher_token: ${{ secrets.RANCHER_B_TOKEN }}
- name: Deploys ${{ matrix.target.chain }}net release
uses: mobilecoinofficial/gha-k8s-toolbox@v1
with:
action: helm-deploy
rancher_cluster: ${{ env.TARGET_CLUSTER }}
namespace: reserve-auditor-staging
release_name: ${{ matrix.target.chain }}net-${{ env.REPO_NAME }}
rancher_url: ${{ secrets.RANCHER_B_URL }}
rancher_token: ${{ secrets.RANCHER_B_TOKEN }}
chart_repo: ${{ env.CHART_REPO }}
chart_name: ${{ env.REPO_NAME}}
chart_version: ${{ github.ref_name }}
chart_values: ${{ env.CHART_PATH }}/${{ matrix.target.chain }}net-values.yaml
# CBB: change mobilecoind.image to reserveAuditor.image...
chart_set: |
--set=mobilecoind.image.tag=${{ github.ref_name }}-${{ matrix.target.chain }}net
--set=ingress.host=auditor.stage.${{ matrix.target.chain }}.mobilecoin.com
--set=frontend.network=${{ matrix.target.network }}