From abf58daa92b92e4a7c45017970d289be96d616d2 Mon Sep 17 00:00:00 2001 From: Mirza Karacic Date: Wed, 4 Dec 2024 11:36:26 -0800 Subject: [PATCH] Adding dev workflows --- .github/actions/build-and-test/action.yaml | 53 +++++++ .../actions/fast-forward-merge/action.yaml | 36 +++++ .github/actions/publish-to-jfrog/action.yaml | 52 ++++++ .github/actions/run-ee-server/action.yaml | 52 ++++++ .../wait-for-as-server-to-start/action.yaml | 22 +++ .github/workflows/build-dev.yaml | 87 ++++++++++ .github/workflows/build.yaml | 73 +++++++++ .github/workflows/build.yml | 21 --- .github/workflows/promote-prod.yaml | 21 +++ .github/workflows/promote-to-stage.yaml | 33 ++++ .github/workflows/promote.yaml | 60 +++++++ .github/workflows/pull-request-open-dev.yaml | 36 +++++ .github/workflows/push-to-dev.yaml | 16 ++ .gitignore | 2 + benchmarks/pom.xml | 30 +++- client/pom.xml | 148 +++++++++++++++++- client/src/resources/bouncy_pom.xml | 46 ++++++ client/src/resources/gnu_pom.xml | 46 ++++++ examples/pom.xml | 30 +++- pom.xml | 3 +- set_crypto | 28 +++- test/pom.xml | 31 +++- 22 files changed, 886 insertions(+), 40 deletions(-) create mode 100644 .github/actions/build-and-test/action.yaml create mode 100644 .github/actions/fast-forward-merge/action.yaml create mode 100644 .github/actions/publish-to-jfrog/action.yaml create mode 100644 .github/actions/run-ee-server/action.yaml create mode 100644 .github/actions/wait-for-as-server-to-start/action.yaml create mode 100644 .github/workflows/build-dev.yaml create mode 100644 .github/workflows/build.yaml delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/promote-prod.yaml create mode 100644 .github/workflows/promote-to-stage.yaml create mode 100644 .github/workflows/promote.yaml create mode 100644 .github/workflows/pull-request-open-dev.yaml create mode 100644 .github/workflows/push-to-dev.yaml create mode 100644 client/src/resources/bouncy_pom.xml create mode 100644 client/src/resources/gnu_pom.xml diff --git a/.github/actions/build-and-test/action.yaml b/.github/actions/build-and-test/action.yaml new file mode 100644 index 000000000..f9ab2d19b --- /dev/null +++ b/.github/actions/build-and-test/action.yaml @@ -0,0 +1,53 @@ +name: Build and est +description: "Build and test code base" + +inputs: + crypto-type: + description: "" + required: false + default: gnu + use-server-rc: + required: false + default: "false" + description: "Test against server release candidate?" + server-tag: + required: false + default: "latest" + description: "Server docker image tag" + jfrog_docker_username: + required: true + description: "" + jfrog_docker_token: + required: true + description: "" + run-tests: + required: true + default: "false" + description: Spin up aerospike enterprise server and run tests + +runs: + using: "composite" + steps: + - name: Stage crypto + shell: bash + run: | + ./set_cypto ${{ inputs.crypto-type }} + + - name: Build + shell: bash + run: mvn clean install -P ${{ inputs.crypto-type }} + + - name: Run EE server + if: ${{ inputs.run-tests == 'true' }} + uses: ./.github/actions/run-ee-server + with: + use-server-rc: ${{ inputs.use-server-rc }} + server-tag: ${{ inputs.server-tag }} + docker-hub-username: ${{ inputs.jfrog_docker_username }} + docker-hub-password: ${{ inputs.jfrog_docker_token }} + + - name: Test + shell: bash + if: ${{ inputs.run-tests == true }} + working-directory: test + run: mvn test -DskipTests=false diff --git a/.github/actions/fast-forward-merge/action.yaml b/.github/actions/fast-forward-merge/action.yaml new file mode 100644 index 000000000..d917069b5 --- /dev/null +++ b/.github/actions/fast-forward-merge/action.yaml @@ -0,0 +1,36 @@ +name: "Fast forward merge" +description: Fast forward target branch to given commit hash + +inputs: + ref_to_merge: + description: Branch to merge into base + required: true + base_branch: + description: Base branch + required: true + git-bot-token: + description: Git bot token + required: true + +runs: + using: composite + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + # Fetch the whole history to prevent unrelated history errors + fetch-depth: "0" + ref: ${{ inputs.base_branch }} + token: ${{ inputs.git-bot-token }} + + - name: Debug stuff + shell: bash + run: | + git remote -vvv + - name: Fast forward + shell: bash + run: git merge --ff-only ${{ inputs.ref_to_merge }} + + - name: Upload changes to remote head branch + shell: bash + run: git push diff --git a/.github/actions/publish-to-jfrog/action.yaml b/.github/actions/publish-to-jfrog/action.yaml new file mode 100644 index 000000000..68f8a7654 --- /dev/null +++ b/.github/actions/publish-to-jfrog/action.yaml @@ -0,0 +1,52 @@ +name: Publish artifacts to JFrog +description: "Publishes artifacts to JFrog" + +inputs: + jfrog-releases-repo-name: + description: "" + required: false + default: clients-maven-dev-local + jfrog-snapshots-repo-name: + description: "" + required: false + default: clients-maven-dev-local + jfrog-platform-url: + description: "" + required: false + default: https://aerospike.jfrog.io/ + oidc-provider: + description: "" + required: false + default: gh-aerospike-clients + oidc-audience: + description: "" + required: false + default: aerospike/clients + crypto-type: + description: "" + required: false + default: gnu + +runs: + using: "composite" + steps: + - name: Set up JFrog credentials + uses: jfrog/setup-jfrog-cli@v4 + env: + JF_URL: ${{ inputs.jfrog-platform-url }} + with: + oidc-provider-name: ${{ inputs.oidc-provider }} + oidc-audience: ${{ inputs.oidc-audience }} + + - name: Set crypto dependency + shell: bash + run: | + ./set_crypto ${{ inputs.crypto-type }} + + - name: Deploy release + shell: bash + working-directory: client + run: | + jf mvn-config --repo-deploy-releases=${{ inputs.jfrog-releases-repo-name }} --repo-deploy-snapshots=${{ inputs.jfrog-snapshots-repo-name }} + jf mvn source:jar javadoc:jar deploy -Dusername=${{ steps.setup-jfrog-cli.outputs.oidc-user }} ${{ steps.setup-jfrog-cli.outputs.oidc-token }} + jf rt bp diff --git a/.github/actions/run-ee-server/action.yaml b/.github/actions/run-ee-server/action.yaml new file mode 100644 index 000000000..22510249c --- /dev/null +++ b/.github/actions/run-ee-server/action.yaml @@ -0,0 +1,52 @@ +name: "Run EE Server" +description: "Run EE server. Returns once server is ready. Only tested on Linux and macOS" + +inputs: + # All inputs in composite actions are strings + use-server-rc: + description: Flag for rc candidates + required: true + default: "false" + server-tag: + description: Server version to use + required: true + default: "latest" + container-repo-url: + required: false + description: Container repo url + default: aerospike.jfrog.io/docker/ + oidc-provider: + description: "" + required: false + default: gh-aerospike-clients + oidc-audience: + description: "" + required: false + default: aerospike/clients + +runs: + using: "composite" + steps: + - name: Set up JFrog credentials + uses: jfrog/setup-jfrog-cli@v4 + env: + JF_URL: ${{ inputs.jfrog-platform-url }} + with: + oidc-provider-name: ${{ inputs.oidc-provider }} + oidc-audience: ${{ inputs.oidc-audience }} + + - name: Log into Docker Hub to get server RC + if: ${{ inputs.use-server-rc == 'true' }} + run: docker login ${{ inputs.container-repo-url }} --username ${{ inputs.docker-hub-username }} --password ${{ inputs.docker-hub-password }} + shell: bash + + - run: echo IMAGE_NAME=${{ inputs.use-server-rc == 'true' && inputs.container-repo-url || '' }}aerospike/aerospike-server-enterprise${{ inputs.use-server-rc == 'true' && '-rc' || '' }}:${{ inputs.server-tag }} >> $GITHUB_ENV + shell: bash + + - run: docker run -d --name aerospike -p 3000:3000 ${{ env.IMAGE_NAME }} + shell: bash + + - uses: ./.github/actions/wait-for-as-server-to-start + with: + container-name: aerospike + is-security-enabled: true diff --git a/.github/actions/wait-for-as-server-to-start/action.yaml b/.github/actions/wait-for-as-server-to-start/action.yaml new file mode 100644 index 000000000..591c89434 --- /dev/null +++ b/.github/actions/wait-for-as-server-to-start/action.yaml @@ -0,0 +1,22 @@ +name: "Wait for Aerospike server to start" +description: Only tested on Linux and macOS +inputs: + container-name: + description: Container name + required: true + is-security-enabled: + description: Flag to toggle docker hub creds use. With this flag enabled before attempting to pull image we will attempt to log in do docker hub. + required: false + default: "false" + +runs: + using: "composite" + steps: + # Composite actions doesn't support step-level timeout-minutes + # Use timeout command and store polling logic in file to make it easier to read + # Call bash shell explicitly since timeout uses "sh" shell by default, for some reason + # Also, we don't want to fail if we timeout in case the server *did* finish starting up but the script couldn't detect it due to a bug + # Effectively, this composite action is like calling "sleep" that is optimized to exit early when it detects an ok from the server + - name: Wait for EE server to start + run: timeout 30 bash ./.github/workflows/scripts/wait-for-as-server-to-start.sh ${{ inputs.container-name }} ${{ inputs.is-security-enabled }} || true + shell: bash diff --git a/.github/workflows/build-dev.yaml b/.github/workflows/build-dev.yaml new file mode 100644 index 000000000..2a47beab5 --- /dev/null +++ b/.github/workflows/build-dev.yaml @@ -0,0 +1,87 @@ +on: + workflow_call: + inputs: + branch: + type: string + required: true + source-branch: + type: string + required: false + use-server-rc: + type: boolean + required: false + default: false + description: "Test against server release candidate?" + server-tag: + type: string + required: false + default: "latest" + description: "Server docker image tag" + upload-artifacts: + type: boolean + required: false + default: false + description: "Upload built artifacts to github?" + bump-version: + type: boolean + required: false + default: false + description: "Bump artifact version" + run-tests: + type: boolean + required: false + default: false + description: Spin up aerospike enterprise server and run tests + +jobs: + debug-job: + runs-on: ubuntu-latest + steps: + - name: debug + run: | + echo "${{ inputs.branch }}" + echo "${{ github.base_ref }}" + + java-version: + needs: debug-job + runs-on: ubuntu-latest + outputs: + java-version: ${{ steps.get-java-version.outputs.java-version }} + steps: + - name: Checkout client + uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch }} + + - name: Get java version + id: get-java-version + run: | + echo java-version="$(grep '' pom.xml | sed -e 's/<[^>]*>//g' | awk '{$1=$1};1')" >> $GITHUB_OUTPUT + + - name: debug - print java-version + run: | + echo ${{ steps.get-java-version.outputs.java-version }} + + debug-java-version-job: + runs-on: ubuntu-latest + needs: java-version + steps: + - name: debug + run: | + echo "${{ needs.java-version.outputs.java-version }}" + + build: + uses: ./.github/workflows/build.yaml + needs: java-version + strategy: + matrix: + crypto-type: ["bouncycastle", "gnu"] + with: + java-version: ${{ needs.java-version.outputs.java-version }} + branch: ${{ inputs.branch }} + use-server-rc: ${{ inputs.use-server-rc }} + run-tests: ${{ inputs.run-tests }} + server-tag: ${{ inputs.server-tag }} + upload-artifacts: ${{ inputs.upload-artifacts }} + crypto-type: ${{ matrix.crypto-type }} + secrets: inherit diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..f422b6b87 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,73 @@ +name: Build artifacts + +permissions: + # This is required for requesting the OIDC token + id-token: write + +on: + workflow_call: + inputs: + branch: + type: string + required: true + java-version: + type: string + required: true + use-server-rc: + type: boolean + required: false + default: false + description: "Test against server release candidate?" + server-tag: + type: string + required: false + default: "latest" + description: "Server docker image tag" + upload-artifacts: + type: boolean + required: false + default: false + description: "Upload built artifacts to github?" + run-tests: + type: boolean + required: false + default: false + description: Spin up aerospike enterprise server and run tests + crypto-type: + type: string + required: true + secrets: + GPG_SECRET_KEY: + required: true + GPG_PASS: + required: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout client + uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch }} + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: "semeru" # See 'Supported distributions' for available options + java-version: ${{ inputs.java-version }} + gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} + gpg-passphrase: ${{ secrets.GPG_PASS }} + + - name: Build and test + uses: ./.github/actions/build-and-test + with: + crypto-type: ${{ inputs.crypto-type }} + server-tag: ${{ inputs.server-tag }} + use-server-rc: ${{ inputs.use-server-rc }} + + - name: Publish to JFrog + if: ${{ !cancelled() && inputs.upload-artifacts == true }} + uses: ./.github/actions/publish-to-jfrog + with: + crypto-type: ${{ inputs.crypto-type }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index d9bacbec2..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Aerospike Java Client Tests - -on: - push: - branches: - - master - pull_request: - branches: - - '**' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout client - uses: actions/checkout@v2 - - name: Setup Aerospike Database - uses: reugn/github-action-aerospike@v1 - - run: mvn install - - run: cd test - - run: mvn test -DskipTests=false diff --git a/.github/workflows/promote-prod.yaml b/.github/workflows/promote-prod.yaml new file mode 100644 index 000000000..63f03a009 --- /dev/null +++ b/.github/workflows/promote-prod.yaml @@ -0,0 +1,21 @@ +name: Promote to Prod + +permissions: + # This is required for requesting the OIDC token + id-token: write + +on: + workflow_dispatch: + inputs: + build-number: + type: number + description: Build number used to build artifact to be promoted + +jobs: + promote-from-stage-to-prod: + name: Promot from stage to prod + uses: ./.github/workflows/promote.yaml + with: + build-number: ${{ inputs.build-number }} + target-repository: client-maven-stage-local + target-branch: dev-stage diff --git a/.github/workflows/promote-to-stage.yaml b/.github/workflows/promote-to-stage.yaml new file mode 100644 index 000000000..fe52abdf9 --- /dev/null +++ b/.github/workflows/promote-to-stage.yaml @@ -0,0 +1,33 @@ +name: Promote to Stage + +permissions: + # This is required for requesting the OIDC token + id-token: write + +on: + workflow_dispatch: + inputs: + build-number: + type: number + description: Build number used to build artifact to be promoted + +jobs: + validate-build: + runs-on: ubuntu-latest + steps: + - name: Setup jfrog shell + uses: jfrog/setup-jfrog-cli@v4 + env: + JF_URL: ${{ vars.JFROG_PLATFORM_URL }} + with: + oidc-provider-name: ${{ inputs.oidc-provider }} + oidc-audience: ${{ inputs.oidc-audience }} + + - name: Get info + id: get-build-info + run: | + echo build-info=$(jf rt curl /api/build/clients-java-push-to-dev/${{ inputs.build-number }}) >> $GITHUB_OUTPUT + + - name: Debug + run: | + echo ${{ steps.get-build-info.outputs.build-info }} diff --git a/.github/workflows/promote.yaml b/.github/workflows/promote.yaml new file mode 100644 index 000000000..302218397 --- /dev/null +++ b/.github/workflows/promote.yaml @@ -0,0 +1,60 @@ +name: Promote + +on: + workflow_call: + inputs: + build-number: + type: number + description: Build number used to build artifact to be promoted + target-repository: + type: string + description: Repository to promote to + target-branch: + type: string + description: Target branch to promote token + secrets: + CLIENT_BOT_PAT: + required: true + +jobs: + validate-build: + runs-on: ubuntu-latest + steps: + - name: Setup jfrog shell + uses: jfrog/setup-jfrog-cli@v4 + env: + JF_URL: ${{ vars.JFROG_PLATFORM_URL }} + with: + oidc-provider-name: ${{ inputs.oidc-provider }} + oidc-audience: ${{ inputs.oidc-audience }} + + - name: Get info + id: get-build-info + run: | + echo build-info=$(jf rt curl /api/build/clients-java-push-to-dev/${{ inputs.build-number }}) >> $GITHUB_OUTPUT + + - name: Get commit hash from repo + id: get-commit-hash + run: | + echo commit-hash=$(steps.get-build-info.outputs.build-info | jq -r '.vcs[].revision') >> $GITHUB_OUTPUT + + - name: Get commit hash from repo + id: get-build-name + run: | + echo build-name=$(steps.get-build-info.outputs.build-info | jq -r '.name') >> $GITHUB_OUTPUT + + - name: Debug + run: | + echo ${{ steps.get-build-info.outputs.build-info }} + echo ${{ steps.get-build-info.outputs.build-name }} + + - name: Merge commit hash from source to target branch + uses: ./github/actions/fast-forward-merge + with: + ref-to-merge: ${{ steps.get-build-info.outputs.build-info }} + base-branch: ${{ inputs.target-branch }} + git-bot-token: ${{ secrets.CLIENT_BOT_PAT }} + + - name: Promote build + run: | + jf rt build-promote ${{ steps.get-build-info.outputs.build-name }} ${{ inputs.build-number }} ${{ inputs.target-repository }} diff --git a/.github/workflows/pull-request-open-dev.yaml b/.github/workflows/pull-request-open-dev.yaml new file mode 100644 index 000000000..bc8b0ae0b --- /dev/null +++ b/.github/workflows/pull-request-open-dev.yaml @@ -0,0 +1,36 @@ +name: PR open + +on: + pull_request: + branches: + - "dev/*" + types: + - opened + - reopened + workflow_dispatch: + inputs: + source-branch: + type: string + description: Base branch to use if manually starting. By default base_ref will empty if triggering manually hence base_ref is only available on PRs. + +jobs: + test-with-server-release: + name: Build stage - Test with latest version of Aerospike Enterprise Server + uses: ./.github/workflows/build-dev.yaml + with: + branch: ${{ github.ref }} + source-branch: ${{ inputs.source-branch || github.base_ref }} + use-server-rc: false + upload-artifacts: false + secrets: inherit + + test-with-server-rc: + name: Build stage - Test with latest RC version of Aerospike Enterprise Server + uses: ./.github/workflows/build-dev.yaml + with: + branch: ${{ github.base_ref || inputs.branch }} + source-branch: ${{ inputs.source-branch || github.base_ref }} + use-server-rc: true + upload-artifacts: false + run-tests: true + secrets: inherit diff --git a/.github/workflows/push-to-dev.yaml b/.github/workflows/push-to-dev.yaml new file mode 100644 index 000000000..ccc8c95e0 --- /dev/null +++ b/.github/workflows/push-to-dev.yaml @@ -0,0 +1,16 @@ +name: clients-java-push-to-dev + +on: + push: + branches: + - dev/* + workflow_dispatch: + +jobs: + build-stage: + name: Build stage + uses: ./.github/workflows/build-dev.yaml + with: + branch: ${{ github.ref }} + upload-artifacts: true + secrets: inherit diff --git a/.gitignore b/.gitignore index 56939ee10..99bc3ed29 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ apidocs *.iml .idea/ dependency-reduced-pom.xml +gnu.config +bouncycastle.config diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index 65f8ef105..8a11165fd 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -15,7 +15,7 @@ com.aerospike - aerospike-client-jdk21 + aerospike-client${crypto.type}-jdk21 @@ -53,6 +53,34 @@ + + + bouncycastle + + + + ../bouncycastle.config + + + + + -bc + + + + + gnu + + + true + + + + + + + + ${project.basedir}/src diff --git a/client/pom.xml b/client/pom.xml index f96f92c83..cef3d5817 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -52,12 +52,6 @@ true - - org.gnu - gnu-crypto - 2.0.1 - - org.luaj luaj-jse @@ -69,7 +63,144 @@ + + + bouncycastle + + + ../bouncycastle.config + + + + + -bc + + + + + org.bouncycastle + bcprov-jdk15on + 1.69 + + + + + + maven-antrun-plugin + 3.1.0 + + + copy-dev-files + process-resources + + + + + + + run + + + + + + + org.apache.maven.plugins + maven-install-plugin + 3.1.3 + + + install-custom-pom + install + + install-file + + + ${project.basedir}/src/resources/bouncy_pom.xml + target/${project.build.finalName}.jar + com.aerospike + aerospike-client${crypto.type}-jdk21 + + + + + + + + + + gnu + + true + + + + + + + + + org.gnu + gnu-crypto + 2.0.1 + + + + + + + maven-antrun-plugin + 3.1.0 + + + copy-dev-files + process-resources + + + + + + + run + + + + + + + + org.apache.maven.plugins + maven-install-plugin + 3.1.3 + + + install-custom-pom + install + + install-file + + + ${project.basedir}/src/resources/gnu_pom.xml + target/${project.build.finalName}.jar + com.aerospike + aerospike-client${crypto.type}-jdk21 + + + + + + + + + + + aerospike-client${crypto.type}-jdk21-${version} ${project.basedir}/src @@ -168,8 +299,9 @@ com/aerospike/client/query/Statement.java com/aerospike/client/util/ThreadLocalData.java - - + + + diff --git a/client/src/resources/bouncy_pom.xml b/client/src/resources/bouncy_pom.xml new file mode 100644 index 000000000..c32d7bea6 --- /dev/null +++ b/client/src/resources/bouncy_pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.aerospike + aerospike-client-bc-jdk21 + 9.0.1 + jar + Aerospike Java Client BC + Aerospike Java client interface to Aerospike database server. Uses Bouncy Castle crypto library for RIPEMD-160 hashing. + https://github.com/aerospike/aerospike-client-java + + Aerospike Inc. + https://www.aerospike.com + + + + The Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + scm:git:git@github.com:aerospike/aerospike-client-java.git + https://github.com/aerospike/aerospike-client-java + + + + org.bouncycastle + bcprov-jdk15on + 1.69 + + + org.luaj + luaj-jse + 3.0.1 + + + org.mindrot + jbcrypt + 0.4 + + + + org.sonatype.oss + oss-parent + 7 + + diff --git a/client/src/resources/gnu_pom.xml b/client/src/resources/gnu_pom.xml new file mode 100644 index 000000000..3682ae49a --- /dev/null +++ b/client/src/resources/gnu_pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.aerospike + aerospike-client-jdk21 + 9.0.1 + jar + Aerospike Java Client + Aerospike Java client interface to Aerospike database server + https://github.com/aerospike/aerospike-client-java + + Aerospike Inc. + https://www.aerospike.com + + + + The Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + scm:git:git@github.com:aerospike/aerospike-client-java.git + https://github.com/aerospike/aerospike-client-java + + + + org.gnu + gnu-crypto + 2.0.1 + + + org.luaj + luaj-jse + 3.0.1 + + + org.mindrot + jbcrypt + 0.4 + + + + org.sonatype.oss + oss-parent + 7 + + diff --git a/examples/pom.xml b/examples/pom.xml index d1552cbda..9743520ce 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -16,7 +16,7 @@ com.aerospike - aerospike-client-jdk21 + aerospike-client${crypto.type}-jdk21 @@ -54,6 +54,34 @@ + + + bouncycastle + + + + ../bouncycastle.config + + + + + -bc + + + + + gnu + + + true + + + + + + + + ${project.basedir}/src diff --git a/pom.xml b/pom.xml index bad3815d2..7103212e5 100644 --- a/pom.xml +++ b/pom.xml @@ -43,13 +43,14 @@ 0.4 1.9.0 4.13.1 + com.aerospike - aerospike-client-jdk21 + aerospike-client${crypto.type}-jdk21 ${project.version} diff --git a/set_crypto b/set_crypto index e5391f73d..484eb04b9 100755 --- a/set_crypto +++ b/set_crypto @@ -2,21 +2,35 @@ # The default crypto library is gnu-crypto. # This script can change crypto library to bouncy castle's bcprov-jdk15on. -cd `dirname $0` +# Clean up old files +function clean_up() { + if [ -f "gnu.config" ]; then + rm "gnu.config" + fi + + if [ -f "bouncycastle.config" ]; then + rm "bouncycastle.config" + fi +} + +cd $(dirname $0) case "$1" in + gnu) set -x - cp client/crypto/gnu/Crypto.java client/src/com/aerospike/client/util - sed 's/org.bouncycastle/org.gnu/;s/bcprov-jdk15on/gnu-crypto/;s/1.69/2.0.1/' client/pom.xml > tmp.xml - mv tmp.xml client/pom.xml + + clean_up + + touch gnu.config ;; bouncycastle) set -x - cp client/crypto/bouncycastle/Crypto.java client/src/com/aerospike/client/util - sed 's/org.gnu/org.bouncycastle/;s/gnu-crypto/bcprov-jdk15on/;s/2.0.1/1.69/' client/pom.xml > tmp.xml - mv tmp.xml client/pom.xml + + clean_up + + touch bouncycastle.config ;; *) diff --git a/test/pom.xml b/test/pom.xml index f78b86691..a0a2542bd 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -21,7 +21,7 @@ com.aerospike - aerospike-client-jdk21 + aerospike-client${crypto.type}-jdk21 @@ -64,6 +64,35 @@ + + + + bouncycastle + + + + ../bouncycastle.config + + + + + -bc + + + + + gnu + + + true + + + + + + + + ${project.basedir}/src