Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
EVEREST-107 test release build only BE
Browse files Browse the repository at this point in the history
  • Loading branch information
oksana-grishchenko committed Oct 25, 2023
1 parent dd03865 commit 26f13d3
Showing 1 changed file with 43 additions and 102 deletions.
145 changes: 43 additions & 102 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Release

on:
workflow_dispatch:
inputs:
tag:
description: The release tag in v*.*.* format
required: true
push:
branches:
- test-release-pipeline-build

env:
NODE_OPTIONS: "--max_old_space_size=4096"
Expand All @@ -14,117 +12,60 @@ jobs:
build:
runs-on: ubuntu-latest
env:
TAG: ${{ github.event.inputs.tag }}
RC_BRANCH: '' # the release branch is based on the RC branch
TAG: v123.123.333
RC_BRANCH: release-v123.123.333
steps:
- name: Validate input
run: |
echo $RC_BRANCH
if [[ ! $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Wrong tag format provided, please use v*.*.* format"
exit 1
fi
- name: Define release branch name in the format "release-*.*.*"
run: |
echo "RC_BRANCH=release-${TAG#v}" >> $GITHUB_ENV
- name: Configure git for private modules
env:
ROBOT_TOKEN: ${{ secrets.ROBOT_TOKEN }}
run: git config --global url."https://percona-platform-robot:${ROBOT_TOKEN}@github.com".insteadOf "https://github.com"

- name: Configure git userdata for commits
run: |
git config --global user.email "[email protected]"
git config --global user.name "Everest RC CI triggered by ${{ github.actor }}"
- name: Everest Frontend - check out
uses: actions/checkout@v4
with:
repository: percona/percona-everest-frontend
ref: ${{ env.RC_BRANCH }}
path: percona-everest-frontend
token: ${{ secrets.ROBOT_TOKEN }}

- name: Everest Frontend - create tag
run: |
cd percona-everest-frontend
git tag -a $TAG -m "Release ${TAG}"
git push origin $TAG
- name: Everest Frontend - run with Node 16
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Everest Frontend - install Bit Version Manager
run: npm i -g @teambit/bvm

- name: Everest Frontend - install latest Bit version
run: bvm install 1.1.0

- name: Everest Frontend - add bvm bin folder to path
run: echo "$HOME/bin" >> $GITHUB_PATH

- name: Everest Frontend - set up bit config
env:
BIT_TOKEN: ${{ secrets.BIT_TOKEN }}
run: bit config set user.token $BIT_TOKEN

- name: Everest Frontend - build app
run: |
cd ${GITHUB_WORKSPACE}/percona-everest-frontend
bit install --recurring-install
bit snap --build
bit artifacts percona.apps/everest --out-dir ./build
mkdir ${GITHUB_WORKSPACE}/front
cp -rf ./build/percona.apps_everest/artifacts/apps/react-common-js/everest/public/* ${GITHUB_WORKSPACE}/front/
# - name: Everest Frontend - check out
# uses: actions/checkout@v4
# with:
# repository: percona/percona-everest-frontend
# path: percona-everest-frontend
# token: ${{ secrets.ROBOT_TOKEN }}
#
# - name: Everest Frontend - run with Node 16
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node-version }}
#
# - name: Everest Frontend - install Bit Version Manager
# run: npm i -g @teambit/bvm
#
# - name: Everest Frontend - install latest Bit version
# run: bvm install 1.1.0
#
# - name: Everest Frontend - add bvm bin folder to path
# run: echo "$HOME/bin" >> $GITHUB_PATH
#
# - name: Everest Frontend - set up bit config
# env:
# BIT_TOKEN: ${{ secrets.BIT_TOKEN }}
# run: bit config set user.token $BIT_TOKEN
#
# - name: Everest Frontend - build app
# run: |
# cd ${GITHUB_WORKSPACE}/percona-everest-frontend
# bit install --recurring-install
# bit snap --build
# bit artifacts percona.apps/everest --out-dir ./build
# mkdir ${GITHUB_WORKSPACE}/front
# cp -rf ./build/percona.apps_everest/artifacts/apps/react-common-js/everest/public/* ${GITHUB_WORKSPACE}/front/

- name: Everest Backend - check out
uses: actions/checkout@v4
with:
path: ./backend
ref: ${{ env.RC_BRANCH }}

- name: Everest Backend - create tag
run: |
cd backend
# update image names in scripts. since the branch is created based on the RC-branch,
# the perconalab/everest:vX.Y.Z image reference is already present in the scripts
sed -i "s/perconalab\/everest/percona\/percona-everest/g" deploy/quickstart-compose.yml deploy/quickstart-k8s.yaml
echo "$(git diff deploy/quickstart-compose.yml deploy/quickstart-k8s.yaml)"
git commit -a -m "update scripts"

git tag -a $TAG -m "Release ${TAG}"
git push origin $TAG

- name: Everest Backend - Embed Everest Frontend app into backend
run: |
cp -rf ${GITHUB_WORKSPACE}/front/* ${GITHUB_WORKSPACE}/backend/public/dist/
cd ${GITHUB_WORKSPACE}/backend
# - name: Everest Backend - Embed Everest Frontend app into backend
# run: |
# cp -rf ${GITHUB_WORKSPACE}/front/* ${GITHUB_WORKSPACE}/backend/public/dist/
# cd ${GITHUB_WORKSPACE}/backend

- name: Build Everest release
run: GOOS=linux GOARCH=amd64 make release

- name: Everest - Setup docker build metadata
uses: docker/metadata-action@v5
id: meta
with:
images: percona/percona-everest
tags: |
${{ env.TAG }}
latest
- name: Everest - Login to GitHub Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Everest - Build and Push everest release image
uses: docker/build-push-action@v5
with:
context: backend
push: true
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit 26f13d3

Please sign in to comment.