-
Notifications
You must be signed in to change notification settings - Fork 77
feat(database-change): database change task adapt streaming read sql file #1437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
638c463
adapt: database change task use stream read
smallsheeeep 84cd534
fix: unit test
smallsheeeep 7624bca
add: new workflow for task framework test
smallsheeeep abdf87a
fix typo
smallsheeeep 03ac7d7
refine workflow
smallsheeeep 814ab56
refine workflow
smallsheeeep 3c7c096
Merge branch 'dev/4.2.3' into feat/gaoda_423_database_change_adapter
smallsheeeep 1e64c90
Merge branch 'dev/4.2.3' into feat/gaoda_423_database_change_adapter
smallsheeeep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,136 @@ | ||
| ### | ||
| # This workflow is used for testing new task framework | ||
| ### | ||
|
|
||
| name: Build Docker Image For Test | ||
| run-name: ${{ github.event_name }} triggered by ${{ github.actor }} 🚀 | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - "**" | ||
|
|
||
| jobs: | ||
| calculate-version: | ||
| name: Calculate Version Number | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| odc_rpm_release_number: ${{ steps.calculate_version.outputs.odc_rpm_release_number }} | ||
| odc_docker_image_tag: ${{ steps.calculate_version.outputs.odc_docker_image_tag }} | ||
| steps: | ||
| - name: Checkout workspace | ||
| uses: actions/checkout@v3 | ||
| - name: Calculate version number | ||
| id: calculate_version | ||
| run: | | ||
| odc_rpm_release_number=$(date +%Y%m%d%H%M%S) | ||
| echo "odc_rpm_release_number=${odc_rpm_release_number}" >> $GITHUB_OUTPUT | ||
| echo "odc_rpm_release_number=${odc_rpm_release_number}" | ||
| odc_docker_image_tag="latest" | ||
| echo "odc_docker_image_tag=${odc_docker_image_tag}" >> $GITHUB_OUTPUT | ||
| echo "odc_docker_image_tag=${odc_docker_image_tag}" | ||
|
|
||
| build-docker-x86_64: | ||
| name: Build Docker Image (x86_64) | ||
| needs: [ calculate-version ] | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| odc_rpm_release_number: ${{ needs.calculate-version.outputs.odc_rpm_release_number }} | ||
| odc_docker_image_tag: ${{ needs.calculate-version.outputs.odc_docker_image_tag }} | ||
| steps: | ||
| - name: Checkout workspace | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| submodules: "recursive" | ||
| - name: Setup JDK 8 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: "8" | ||
| distribution: "temurin" | ||
| cache: maven | ||
| - name: Setup node 16 | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: "16" | ||
| - name: Build front static resources | ||
| run: | | ||
| echo "Current directory: "`pwd` | ||
| echo "Start build front static resources" | ||
| pushd client | ||
| echo "Run npm install pnpm -g" | ||
| npm install pnpm -g | ||
| echo "Run pnpm install" | ||
| pnpm install | ||
| echo "Run npm run build:odc" | ||
| npm run build:odc | ||
| popd | ||
| echo "Build front static resources success" | ||
| echo "Start copy resources files" | ||
| static_resources_path="server/odc-server/src/main/resources/static" | ||
| if [ ! -d "${static_resources_path}" ]; then | ||
| echo "mkdir -p ${static_resources_path}" | ||
| mkdir -p "${static_resources_path}" | ||
| fi | ||
| rm --force --recursive --verbose ${static_resources_path}/* | ||
| cp --force --recursive --verbose client/dist/renderer/* ${static_resources_path} | ||
| echo "Copy resources files success" | ||
| - name: Set release version | ||
| id: set_release_version | ||
| run: | | ||
| main_version="$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | cut -d - -f 1)" | ||
| new_version="${main_version}-${odc_rpm_release_number}" | ||
| echo "new_version=${new_version}" >> $GITHUB_OUTPUT | ||
| echo "RPM's version is "${new_version} | ||
| mvn versions:set -DnewVersion="${new_version}" | ||
| mvn versions:commit | ||
| - name: Install ob-sql-parser | ||
| run: | | ||
| echo "Start install ob-sql-parser" | ||
| pushd libs/ob-sql-parser | ||
| echo "Current dir is "`pwd` | ||
| mvn clean install -Dmaven.test.skip=true | ||
| echo "Install ob-sql-parser success" | ||
| popd | ||
| - name: Install db-browser | ||
| run: | | ||
| echo "Start install db-browser" | ||
| pushd libs/db-browser | ||
| echo "Current dir is "`pwd` | ||
| mvn clean install -Dmaven.test.skip=true | ||
| echo "Install db-browser success" | ||
| popd | ||
| - name: Build rpm (x86_64) | ||
| run: | | ||
| echo "Start prepare oceanbase-client" | ||
| pushd import | ||
| echo "Current dir is "`pwd` | ||
| cp ../build-resource/obclient/2.2.4/linux_x86/obclient.tar.gz obclient.tar.gz | ||
| popd | ||
| echo "Prepare oceanbase-client success" | ||
| echo "Start build rpm package" | ||
| mvn help:system | ||
| mvn clean install -Dmaven.test.skip=true | ||
| mvn --file server/odc-server/pom.xml rpm:rpm -Drpm.prefix=/opt | ||
| echo "Build rpm package success" | ||
| rm --force --recursive --verbose distribution/docker/resources/odc-*.rpm | ||
| mkdir -p distribution/docker/resources/ | ||
| mv --verbose server/odc-server/target/rpm/odc-server/RPMS/*/odc-*.rpm distribution/docker/resources/ | ||
| - name: Build docker image (x86_64) | ||
| run: | | ||
| sed -e "s/DATE_CHANGE/$(date)/" -i distribution/docker/odc/Dockerfile | ||
| echo "odc_docker_image_tag=${odc_docker_image_tag}" | ||
| pushd distribution/docker | ||
| docker build -t docker.io/oceanbase/odc:${odc_docker_image_tag} -f odc/Dockerfile . | ||
| docker save -o resources/odc-${odc_docker_image_tag}.tar.gz docker.io/oceanbase/odc:${odc_docker_image_tag} | ||
| popd | ||
| - name: Push docker image (x86_64) | ||
| run: | | ||
| docker login -p${{ secrets.DOCKER_PASSWORD }} -u${{ secrets.DOCKER_USERNAME }} | ||
| docker load -i distribution/docker/resources/odc-${odc_docker_image_tag}.tar.gz | ||
| docker tag oceanbase/odc:${odc_docker_image_tag} ${{ secrets.DOCKER_USERNAME }}/odc:${odc_docker_image_tag} | ||
| docker push ${{ secrets.DOCKER_USERNAME }}/odc:${odc_docker_image_tag} | ||
| - name: Upload docker image (x86_64) | ||
|
smallsheeeep marked this conversation as resolved.
Outdated
|
||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: odc-${{ env.odc_docker_image_tag }}.tar.gz | ||
| path: distribution/docker/resources/odc-*.tar.gz | ||
This file contains hidden or 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
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.