From d7e5551ec5fd83fb33ea110ad3980bed7ce80646 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 25 Sep 2023 23:16:12 +0200 Subject: [PATCH 01/13] EVEREST-429 --- .github/workflows/release.yml | 123 ++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c3a350b8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,123 @@ +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 + git push origin $RC_BRANCH + + # update tag refs in scripts + sed -i "s/dev-latest/$VERSION/g" deploy/quickstart-compose.yml deploy/quickstart-k8s.yaml + + # configure userdata for commits + git config --global user.email "everest-ci@percona.com" + 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 From cff087077a2ed1d9e2e72c71808c4f46fe25c151 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 26 Sep 2023 11:05:46 +0200 Subject: [PATCH 02/13] draft --- .github/workflows/release.yml | 143 +++++++++++++++++++++------------- 1 file changed, 90 insertions(+), 53 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3a350b8..394d3514 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Create RC branches +name: Release on: workflow_dispatch: @@ -30,94 +30,131 @@ jobs: 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 + - name: Configure git userdata for commits + run: | + git config --global user.email "everest-ci@percona.com" + git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" + + - name: Everest CLI - check out uses: actions/checkout@v4 with: repository: percona/percona-everest-cli - ref: 'main' + ref: ${{ env.RELEASE_BRANCH_NAME }} path: percona-everest-cli token: ${{ secrets.ROBOT_TOKEN }} - - name: Create Everest CLI RC-branch + - name: Everest CLI - create tag run: | cd percona-everest-cli - # Check if the branch already exists - git fetch - check_branch=$(git ls-remote --heads origin ${RC_BRANCH}) + git tag $VERSION - if [[ -z ${check_branch} ]]; then - git checkout -b $RC_BRANCH - git push origin $RC_BRANCH - fi + # !!! update scripts - tag & registry name + git push origin $VERSION + + - name: Everest CLI - create release + run: | + # !!!! create release without pre-release tag - - name: Check out Everest catalog + - name: Everest catalog - check out uses: actions/checkout@v4 with: repository: percona/everest-catalog - ref: 'main' + ref: ${{ env.RELEASE_BRANCH_NAME }} path: everest-catalog token: ${{ secrets.ROBOT_TOKEN }} - - name: Create Everest catalog RC-branch + - name: Everest catalog - create tag 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 + git tag $VERSION + # !!! update smth? - - name: Check out Everest frontend + git push origin $VERSION + + + - name: Everest frontend - check out uses: actions/checkout@v4 with: repository: percona/percona-everest-frontend - ref: 'main' + ref: ${{ env.RELEASE_BRANCH_NAME }} path: percona-everest-frontend token: ${{ secrets.ROBOT_TOKEN }} - - name: Create Everest Frontend RC-branch + - name: Everest Frontend - create tag run: | cd percona-everest-frontend - - # Check if the branch already exists - git fetch - check_branch=$(git ls-remote --heads origin ${RC_BRANCH}) + git tag $VERSION + git push origin $VERSION - if [[ -z ${check_branch} ]]; then - git checkout -b $RC_BRANCH - git push origin $RC_BRANCH - fi + - name: 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 0.2.3 + + - name: Everest Frontend - add bvm bin folder to path + run: echo "$HOME/bin" >> $GITHUB_PATH - - name: Check out Everest Backend + - 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 + 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: Everest Backend - check out uses: actions/checkout@v4 with: path: ./backend - ref: 'main' + ref: ${{ env.RELEASE_BRANCH_NAME }} - - name: Create and update Everest Backend RC-branch + - name: Everest Backend - create tag run: | cd backend # Check if the branch already exists - git fetch - check_branch=$(git ls-remote --heads origin ${RC_BRANCH}) + git tag $VERSION - if [[ -z ${check_branch} ]]; then - git checkout -b $RC_BRANCH - git push origin $RC_BRANCH - - # update tag refs in scripts - sed -i "s/dev-latest/$VERSION/g" deploy/quickstart-compose.yml deploy/quickstart-k8s.yaml - - # configure userdata for commits - git config --global user.email "everest-ci@percona.com" - 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 + # !!! update tag refs in scripts + sed -i "s/dev-latest/$VERSION/g" deploy/quickstart-compose.yml deploy/quickstart-k8s.yaml + + git push origin $VERSION + + - 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 - Setup docker build metadata + uses: docker/metadata-action@v5 + id: meta + with: + images: percona/percona-everest + tags: ${{ env.VERSION }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push everest RC-image + uses: docker/build-push-action@v5 + with: + context: backend + push: true + tags: ${{ steps.meta.outputs.tags }} From 816248c9c758ff8ed5ec83f0b6247c4ed1cb518c Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 26 Sep 2023 14:54:50 +0200 Subject: [PATCH 03/13] draft --- .github/workflows/release.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 394d3514..dd275388 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,13 +48,26 @@ jobs: cd percona-everest-cli git tag $VERSION + # 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)" + # !!! update scripts - tag & registry name git push origin $VERSION - - name: Everest CLI - create release - run: | - # !!!! create release without pre-release tag + - name: Everest CLI - build binaries + run: make release + + # !!! conflict with cli push to tags + - name: Everest CLI - create release with binaries + uses: softprops/action-gh-release@v1 + with: + files: | + dist/* + env: + GITHUB_TOKEN: ${{ github.token }} - name: Everest catalog - check out uses: actions/checkout@v4 @@ -68,9 +81,6 @@ jobs: run: | cd everest-catalog git tag $VERSION - - # !!! update smth? - git push origin $VERSION @@ -88,7 +98,7 @@ jobs: git tag $VERSION git push origin $VERSION - - name: Run with Node 16 + - name: Everest Frontend - run with Node 16 uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} @@ -129,8 +139,10 @@ jobs: # Check if the branch already exists git tag $VERSION - # !!! update tag refs in scripts - sed -i "s/dev-latest/$VERSION/g" deploy/quickstart-compose.yml deploy/quickstart-k8s.yaml + # 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 push origin $VERSION From 547b776a279590e08dab04158251319ce10b8c9c Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 26 Sep 2023 15:42:34 +0200 Subject: [PATCH 04/13] test --- .github/workflows/release.yml | 118 ++++++++++++++++++---------------- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd275388..3d1023ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,12 +6,16 @@ on: version: description: The release version in v*.*.* format required: true + push: + branches: + - EVEREST-429-release-pipeline jobs: build: runs-on: ubuntu-latest env: - VERSION: ${{ github.event.inputs.version }} + # VERSION: ${{ github.event.inputs.version }} + VERSION: v0.3.0 RC_BRANCH: '' steps: - name: Validate input @@ -48,26 +52,25 @@ jobs: cd percona-everest-cli git tag $VERSION - # 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)" - - # !!! update scripts - tag & registry name + # update branch names in the install.sh script: + # e.g. replace release-0.3.0 with v0.3.0 + sed -i "s/$RC_BRANCH/$VERSION/g" install.sh + echo "$(git diff install.sh)" + git commit -a -m "update version tag" - git push origin $VERSION + #git push origin $VERSION - name: Everest CLI - build binaries run: make release # !!! conflict with cli push to tags - - name: Everest CLI - create release with binaries - uses: softprops/action-gh-release@v1 - with: - files: | - dist/* - env: - GITHUB_TOKEN: ${{ github.token }} +# - name: Everest CLI - create release with binaries +# uses: softprops/action-gh-release@v1 +# with: +# files: | +# dist/* +# env: +# GITHUB_TOKEN: ${{ github.token }} - name: Everest catalog - check out uses: actions/checkout@v4 @@ -81,7 +84,7 @@ jobs: run: | cd everest-catalog git tag $VERSION - git push origin $VERSION + # git push origin $VERSION - name: Everest frontend - check out @@ -96,35 +99,35 @@ jobs: run: | cd percona-everest-frontend git tag $VERSION - git push origin $VERSION + # git push origin $VERSION - - 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 0.2.3 - - - 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 - 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: 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 0.2.3 +# +# - 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 +# 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: Everest Backend - check out @@ -143,8 +146,9 @@ jobs: # 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 version tag" - git push origin $VERSION + # git push origin $VERSION - name: Everest Backend - Embed Everest Frontend app into backend run: | @@ -158,15 +162,15 @@ jobs: images: percona/percona-everest tags: ${{ env.VERSION }} - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and Push everest RC-image - uses: docker/build-push-action@v5 - with: - context: backend - push: true - tags: ${{ steps.meta.outputs.tags }} +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v3 +# with: +# username: ${{ secrets.DOCKERHUB_USERNAME }} +# password: ${{ secrets.DOCKERHUB_TOKEN }} +# +# - name: Build and Push everest RC-image +# uses: docker/build-push-action@v5 +# with: +# context: backend +# push: true +# tags: ${{ steps.meta.outputs.tags }} From 6e137e2f499d9d616692f6644ee068438b273e2e Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 26 Sep 2023 15:46:51 +0200 Subject: [PATCH 05/13] u --- .github/workflows/release.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d1023ac..f0fcd1f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: env: # VERSION: ${{ github.event.inputs.version }} VERSION: v0.3.0 - RC_BRANCH: '' + RC_BRANCH: '' # the release branch is based on the RC branch steps: - name: Validate input run: | @@ -43,7 +43,7 @@ jobs: uses: actions/checkout@v4 with: repository: percona/percona-everest-cli - ref: ${{ env.RELEASE_BRANCH_NAME }} + ref: ${{ env.RC_BRANCH }} path: percona-everest-cli token: ${{ secrets.ROBOT_TOKEN }} @@ -72,26 +72,26 @@ jobs: # env: # GITHUB_TOKEN: ${{ github.token }} - - name: Everest catalog - check out + - name: Everest Catalog - check out uses: actions/checkout@v4 with: repository: percona/everest-catalog - ref: ${{ env.RELEASE_BRANCH_NAME }} + ref: ${{ env.RC_BRANCH }} path: everest-catalog token: ${{ secrets.ROBOT_TOKEN }} - - name: Everest catalog - create tag + - name: Everest Catalog - create tag run: | cd everest-catalog git tag $VERSION # git push origin $VERSION - - name: Everest frontend - check out + - name: Everest Frontend - check out uses: actions/checkout@v4 with: repository: percona/percona-everest-frontend - ref: ${{ env.RELEASE_BRANCH_NAME }} + ref: ${{ env.RC_BRANCH }} path: percona-everest-frontend token: ${{ secrets.ROBOT_TOKEN }} @@ -134,7 +134,7 @@ jobs: uses: actions/checkout@v4 with: path: ./backend - ref: ${{ env.RELEASE_BRANCH_NAME }} + ref: ${{ env.RC_BRANCH }} - name: Everest Backend - create tag run: | @@ -162,13 +162,13 @@ jobs: images: percona/percona-everest tags: ${{ env.VERSION }} -# - name: Login to GitHub Container Registry +# - name: Everest - Login to GitHub Container Registry # uses: docker/login-action@v3 # with: # username: ${{ secrets.DOCKERHUB_USERNAME }} # password: ${{ secrets.DOCKERHUB_TOKEN }} # -# - name: Build and Push everest RC-image +# - name: Everest - Build and Push everest release image # uses: docker/build-push-action@v5 # with: # context: backend From 6f7a28f1fa332f2d1e87e5106c244d7e97ab8ac0 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 26 Sep 2023 16:15:55 +0200 Subject: [PATCH 06/13] u --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f0fcd1f6..42f6a500 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,7 +61,9 @@ jobs: #git push origin $VERSION - name: Everest CLI - build binaries - run: make release + run: | + cat Makefile + make release # !!! conflict with cli push to tags # - name: Everest CLI - create release with binaries From d7e857afa7bd3b1dc83e0ab5adef28cb2a9e9878 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 26 Sep 2023 16:17:15 +0200 Subject: [PATCH 07/13] u --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 42f6a500..a422c786 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,7 +62,7 @@ jobs: - name: Everest CLI - build binaries run: | - cat Makefile + echo $(ls) make release # !!! conflict with cli push to tags From 270f3ed80e0466d7f1186af1eb39a5d0ebf562e9 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 26 Sep 2023 16:19:04 +0200 Subject: [PATCH 08/13] u --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a422c786..d194840d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,7 +62,7 @@ jobs: - name: Everest CLI - build binaries run: | - echo $(ls) + cd percona-everest-cli make release # !!! conflict with cli push to tags From fa9b3025233d85053580a832320fb31939522e1f Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 26 Sep 2023 16:48:49 +0200 Subject: [PATCH 09/13] u --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d194840d..95f70f1e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -152,10 +152,10 @@ jobs: # git push origin $VERSION - - 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: Everest - Setup docker build metadata uses: docker/metadata-action@v5 From ed106600e8a2c43407e2f9353e17c360c8ad1b38 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 26 Sep 2023 19:04:09 +0200 Subject: [PATCH 10/13] u --- .github/workflows/release.yml | 144 +++++++++++++++++----------------- 1 file changed, 70 insertions(+), 74 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95f70f1e..c22cd839 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,31 +3,27 @@ name: Release on: workflow_dispatch: inputs: - version: - description: The release version in v*.*.* format + tag: + description: The release tag in v*.*.* format required: true - push: - branches: - - EVEREST-429-release-pipeline jobs: build: runs-on: ubuntu-latest env: - # VERSION: ${{ github.event.inputs.version }} - VERSION: v0.3.0 + TAG: ${{ github.event.inputs.tag }} RC_BRANCH: '' # the release branch is based on the 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" + 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-${VERSION#v}" >> $GITHUB_ENV + echo "RC_BRANCH=release-${TAG#v}" >> $GITHUB_ENV - name: Configure git for private modules env: @@ -50,29 +46,29 @@ jobs: - name: Everest CLI - create tag run: | cd percona-everest-cli - git tag $VERSION + git tag $TAG # update branch names in the install.sh script: # e.g. replace release-0.3.0 with v0.3.0 - sed -i "s/$RC_BRANCH/$VERSION/g" install.sh + sed -i "s/$RC_BRANCH/$TAG/g" install.sh echo "$(git diff install.sh)" - git commit -a -m "update version tag" + git commit -a -m "update scripts" - #git push origin $VERSION + git push origin $TAG - name: Everest CLI - build binaries run: | cd percona-everest-cli make release - # !!! conflict with cli push to tags -# - name: Everest CLI - create release with binaries -# uses: softprops/action-gh-release@v1 -# with: -# files: | -# dist/* -# env: -# GITHUB_TOKEN: ${{ github.token }} + - name: Everest CLI - create release with binaries + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ env.TAG }} + files: | + dist/* + env: + GITHUB_TOKEN: ${{ github.token }} - name: Everest Catalog - check out uses: actions/checkout@v4 @@ -85,8 +81,8 @@ jobs: - name: Everest Catalog - create tag run: | cd everest-catalog - git tag $VERSION - # git push origin $VERSION + git tag $TAG + git push origin $TAG - name: Everest Frontend - check out @@ -100,36 +96,36 @@ jobs: - name: Everest Frontend - create tag run: | cd percona-everest-frontend - git tag $VERSION - # git push origin $VERSION + git tag $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 0.2.3 -# -# - 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 -# 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: 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 0.2.3 + + - 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 + 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: Everest Backend - check out @@ -142,37 +138,37 @@ jobs: run: | cd backend # Check if the branch already exists - git tag $VERSION + git tag $TAG # 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 version tag" + git commit -a -m "update scripts" - # git push origin $VERSION + 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: Everest - Setup docker build metadata uses: docker/metadata-action@v5 id: meta with: images: percona/percona-everest - tags: ${{ env.VERSION }} - -# - 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 }} + tags: ${{ env.TAG }} + + - 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 }} From 0820cbcc8118ae9d1328f8d4184b0d3e0a482e3b Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Sep 2023 10:34:14 +0200 Subject: [PATCH 11/13] remove catalog and cli --- .github/workflows/release.yml | 51 ----------------------------------- 1 file changed, 51 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c22cd839..a2092d3e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,56 +35,6 @@ jobs: git config --global user.email "everest-ci@percona.com" git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" - - name: Everest CLI - check out - uses: actions/checkout@v4 - with: - repository: percona/percona-everest-cli - ref: ${{ env.RC_BRANCH }} - path: percona-everest-cli - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Everest CLI - create tag - run: | - cd percona-everest-cli - git tag $TAG - - # update branch names in the install.sh script: - # e.g. replace release-0.3.0 with v0.3.0 - sed -i "s/$RC_BRANCH/$TAG/g" install.sh - echo "$(git diff install.sh)" - git commit -a -m "update scripts" - - git push origin $TAG - - - name: Everest CLI - build binaries - run: | - cd percona-everest-cli - make release - - - name: Everest CLI - create release with binaries - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ env.TAG }} - files: | - dist/* - env: - GITHUB_TOKEN: ${{ github.token }} - - - name: Everest Catalog - check out - uses: actions/checkout@v4 - with: - repository: percona/everest-catalog - ref: ${{ env.RC_BRANCH }} - path: everest-catalog - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Everest Catalog - create tag - run: | - cd everest-catalog - git tag $TAG - git push origin $TAG - - - name: Everest Frontend - check out uses: actions/checkout@v4 with: @@ -127,7 +77,6 @@ jobs: mkdir ${GITHUB_WORKSPACE}/front cp -rf build/percona.apps_everest/react-common-js/everest/public/* ${GITHUB_WORKSPACE}/front/ - - name: Everest Backend - check out uses: actions/checkout@v4 with: From 722e1ff656fc5dc0f51c8acd690ee20f942960c7 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Sep 2023 10:49:22 +0200 Subject: [PATCH 12/13] add tag latest --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a2092d3e..d98cf619 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -107,7 +107,9 @@ jobs: id: meta with: images: percona/percona-everest - tags: ${{ env.TAG }} + tags: | + ${{ env.TAG }} + latest - name: Everest - Login to GitHub Container Registry uses: docker/login-action@v3 From 1749178c55bf4de659b726369e4f3289063877d5 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Sep 2023 14:33:04 +0200 Subject: [PATCH 13/13] tag the latest commit --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d98cf619..e74846b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,8 +86,6 @@ jobs: - name: Everest Backend - create tag run: | cd backend - # Check if the branch already exists - git tag $TAG # 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 @@ -95,6 +93,7 @@ jobs: echo "$(git diff deploy/quickstart-compose.yml deploy/quickstart-k8s.yaml)" git commit -a -m "update scripts" + git tag $TAG git push origin $TAG - name: Everest Backend - Embed Everest Frontend app into backend