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

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
oksana-grishchenko committed Sep 19, 2023
1 parent 87db04b commit 7ebfeca
Showing 1 changed file with 108 additions and 114 deletions.
222 changes: 108 additions & 114 deletions .github/workflows/rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,96 +51,90 @@ jobs:
path: percona-everest-cli
token: ${{ secrets.ROBOT_TOKEN }}

# - name: Check out Everest CLI RC-branch
# run: |
# cd percona-everest-cli
# # Check if the branch already exists
# echo "!fetch"
# git fetch
# echo "!ls-remote"
# git ls-remote --exit-code --heads origin $RC_BRANCH >/dev/null 2>&1
# echo "!exit code"
# EXIT_CODE=$?
# echo "!before if"
# if [[ $EXIT_CODE == '2' ]]; then
# echo "!in if"
# git checkout -b $RC_BRANCH
# # git push origin $RC_BRANCH <--- UNCOMMENT ME once the permission granted to ROBOT_TOKEN
# echo "!after if"
# fi
- name: Check out 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 <--- UNCOMMENT ME once the permission granted to ROBOT_TOKEN
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: Check out 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 <--- UNCOMMENT ME once the permission granted to ROBOT_TOKEN
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: Check out 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 <--- UNCOMMENT ME once the permission granted to ROBOT_TOKEN
else
git checkout $RC_BRANCH
fi
- name: Run with Node 16
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

# - name: Check out Everest catalog
# uses: actions/checkout@v4
# with:
# repository: percona/everest-catalog
# ref: 'main'
# path: everest-catalog
# token: ${{ secrets.ROBOT_TOKEN }}
#
# - name: Check out Everest catalog RC-branch
# run: |
# cd everest-catalog
# # Check if the branch already exists
# git fetch && git ls-remote --exit-code --heads origin $RC_BRANCH >/dev/null 2>&1
# EXIT_CODE=$?
#
# if [[ $EXIT_CODE != '0' ]]; then
# git checkout -b $RC_BRANCH
# # git push origin $RC_BRANCH <--- UNCOMMENT ME once the permission granted to ROBOT_TOKEN
# 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: Check out Everest Frontend RC-branch
# run: |
# cd percona-everest-frontend
#
# # Check if the branch already exists
# git fetch && git ls-remote --exit-code --heads origin $RC_BRANCH >/dev/null 2>&1
# EXIT_CODE=$?
#
# if [[ $EXIT_CODE != '0' ]]; then
# git checkout -b $RC_BRANCH
# # git push origin $RC_BRANCH <--- UNCOMMENT ME once the permission granted to ROBOT_TOKEN
# else
# git checkout $RC_BRANCH
# fi
#
# - 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: 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
Expand All @@ -162,33 +156,33 @@ jobs:
git diff deploy/quickstart-compose.yml deploy/quickstart-k8s.yaml
# configure userdata for commits
git commit -a -m "update version tag"
git push origin $RC_BRANCH
# git push origin $RC_BRANCH <--- UNCOMMENT ME once the permission granted to ROBOT_TOKEN
else
git checkout $RC_BRANCH
fi
# - 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 }}
- 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 }}

0 comments on commit 7ebfeca

Please sign in to comment.