This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into EVEREST-434
- Loading branch information
Showing
6 changed files
with
480 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: Create RC branches | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: The release version in v*.*.* format | ||
required: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
VERSION: ${{ github.event.inputs.version }} | ||
RC_BRANCH: '' | ||
steps: | ||
- name: Validate input | ||
run: | | ||
echo $RC_BRANCH | ||
if [[ ! $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Wrong version format provided, please use v*.*.* format" | ||
exit 1 | ||
fi | ||
- name: Define release branch name in the format "release-*.*.*" | ||
run: | | ||
echo "RC_BRANCH=release-${VERSION#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: Check out Everest CLI | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: percona/percona-everest-cli | ||
ref: 'main' | ||
path: percona-everest-cli | ||
token: ${{ secrets.ROBOT_TOKEN }} | ||
|
||
- name: Create Everest CLI RC-branch | ||
run: | | ||
cd percona-everest-cli | ||
# Check if the branch already exists | ||
git fetch | ||
check_branch=$(git ls-remote --heads origin ${RC_BRANCH}) | ||
if [[ -z ${check_branch} ]]; then | ||
git checkout -b $RC_BRANCH | ||
git push origin $RC_BRANCH | ||
fi | ||
- name: Check out Everest catalog | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: percona/everest-catalog | ||
ref: 'main' | ||
path: everest-catalog | ||
token: ${{ secrets.ROBOT_TOKEN }} | ||
|
||
- name: Create Everest catalog RC-branch | ||
run: | | ||
cd everest-catalog | ||
# Check if the branch already exists | ||
git fetch | ||
check_branch=$(git ls-remote --heads origin ${RC_BRANCH}) | ||
if [[ -z ${check_branch} ]]; then | ||
git checkout -b $RC_BRANCH | ||
git push origin $RC_BRANCH | ||
fi | ||
- name: Check out Everest frontend | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: percona/percona-everest-frontend | ||
ref: 'main' | ||
path: percona-everest-frontend | ||
token: ${{ secrets.ROBOT_TOKEN }} | ||
|
||
- name: Create Everest Frontend RC-branch | ||
run: | | ||
cd percona-everest-frontend | ||
# Check if the branch already exists | ||
git fetch | ||
check_branch=$(git ls-remote --heads origin ${RC_BRANCH}) | ||
if [[ -z ${check_branch} ]]; then | ||
git checkout -b $RC_BRANCH | ||
git push origin $RC_BRANCH | ||
fi | ||
- name: Check out Everest Backend | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ./backend | ||
ref: 'main' | ||
|
||
- name: Create and update Everest Backend RC-branch | ||
run: | | ||
cd backend | ||
# Check if the branch already exists | ||
git fetch | ||
check_branch=$(git ls-remote --heads origin ${RC_BRANCH}) | ||
if [[ -z ${check_branch} ]]; then | ||
git checkout -b $RC_BRANCH | ||
# update tag refs in scripts | ||
sed -i "s/dev-latest/$RC_BRANCH/g" deploy/quickstart-compose.yml deploy/quickstart-k8s.yaml | ||
# configure userdata for commits | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" | ||
# commit and push the updated files | ||
git commit -a -m "update version tag" | ||
git push origin $RC_BRANCH | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Build and push RC image | ||
|
||
on: | ||
push: | ||
branches: | ||
- release-[0-9]+.[0-9]+.[0-9]+* | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
VERSION: '' | ||
RELEASE_BRANCH_NAME: '' | ||
steps: | ||
- name: Define release branch name | ||
run: | | ||
echo "RELEASE_BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
- name: Define version name | ||
run: | | ||
semantic_version=${RELEASE_BRANCH_NAME#"release-"} | ||
echo "VERSION=v${semantic_version}" >> $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: Check out Everest frontend | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: $ {{ env.RELEASE_BRANCH_NAME }} | ||
path: percona-everest-frontend | ||
token: ${{ secrets.ROBOT_TOKEN }} | ||
|
||
- name: Run with Node 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install Bit Version Manager | ||
run: npm i -g @teambit/bvm | ||
|
||
- name: Install latest Bit version | ||
run: bvm install 0.2.3 | ||
|
||
- name: Add bvm bin folder to path | ||
run: echo "$HOME/bin" >> $GITHUB_PATH | ||
|
||
- name: Set up bit config | ||
env: | ||
BIT_TOKEN: ${{ secrets.BIT_TOKEN }} | ||
run: bit config set user.token $BIT_TOKEN | ||
|
||
- name: Build Everest Frontend app | ||
run: | | ||
cd ${GITHUB_WORKSPACE}/percona-everest-frontend | ||
bit install --recurring-install | ||
bit snap | ||
bit artifacts percona.apps/everest --out-dir build | ||
mkdir ${GITHUB_WORKSPACE}/front | ||
cp -rf build/percona.apps_everest/react-common-js/everest/public/* ${GITHUB_WORKSPACE}/front/ | ||
- name: Check out Everest Backend | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ./backend | ||
ref: $ {{ env.RELEASE_BRANCH_NAME }} | ||
token: ${{ secrets.ROBOT_TOKEN }} | ||
|
||
- name: Embed Everest Frontend app into backend | ||
run: | | ||
cp -rf ${GITHUB_WORKSPACE}/front/* ${GITHUB_WORKSPACE}/backend/public/dist/ | ||
cd ${GITHUB_WORKSPACE}/backend | ||
- name: Setup docker build metadata | ||
uses: docker/metadata-action@v4 | ||
id: meta | ||
with: | ||
images: perconalab/everest | ||
tags: ${{ env.VERSION }} | ||
|
||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and Push everest RC-image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: backend | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.