From 47c8a006f29c4517f17c4c06013490c671631f64 Mon Sep 17 00:00:00 2001 From: Mirza Karacic Date: Wed, 11 Dec 2024 14:37:58 -0800 Subject: [PATCH] Integration fixes --- .github/actions/build-and-test/action.yaml | 4 ++-- .github/actions/fast-forward-merge/action.yaml | 9 +++++---- .github/actions/publish-to-jfrog/action.yaml | 6 ++++-- .github/workflows/promote-prod.yaml | 3 ++- .github/workflows/promote-to-stage.yaml | 15 ++++++++++++--- .github/workflows/promote.yaml | 16 +++++----------- 6 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.github/actions/build-and-test/action.yaml b/.github/actions/build-and-test/action.yaml index f9ab2d19b..27920a827 100644 --- a/.github/actions/build-and-test/action.yaml +++ b/.github/actions/build-and-test/action.yaml @@ -31,11 +31,11 @@ runs: - name: Stage crypto shell: bash run: | - ./set_cypto ${{ inputs.crypto-type }} + ./set_crypto ${{ inputs.crypto-type }} - name: Build shell: bash - run: mvn clean install -P ${{ inputs.crypto-type }} + run: mvn clean install - name: Run EE server if: ${{ inputs.run-tests == 'true' }} diff --git a/.github/actions/fast-forward-merge/action.yaml b/.github/actions/fast-forward-merge/action.yaml index d917069b5..4a4f7e4f5 100644 --- a/.github/actions/fast-forward-merge/action.yaml +++ b/.github/actions/fast-forward-merge/action.yaml @@ -2,10 +2,10 @@ name: "Fast forward merge" description: Fast forward target branch to given commit hash inputs: - ref_to_merge: + ref-to-merge: description: Branch to merge into base required: true - base_branch: + base-branch: description: Base branch required: true git-bot-token: @@ -20,16 +20,17 @@ runs: with: # Fetch the whole history to prevent unrelated history errors fetch-depth: "0" - ref: ${{ inputs.base_branch }} + 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 }} + run: git merge --ff-only ${{ inputs.ref-to-merge }} - name: Upload changes to remote head branch shell: bash diff --git a/.github/actions/publish-to-jfrog/action.yaml b/.github/actions/publish-to-jfrog/action.yaml index 68f8a7654..8c3aaf796 100644 --- a/.github/actions/publish-to-jfrog/action.yaml +++ b/.github/actions/publish-to-jfrog/action.yaml @@ -47,6 +47,8 @@ runs: 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 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 bce && \ + jf rt bag && \ jf rt bp diff --git a/.github/workflows/promote-prod.yaml b/.github/workflows/promote-prod.yaml index 63f03a009..34d3b8b99 100644 --- a/.github/workflows/promote-prod.yaml +++ b/.github/workflows/promote-prod.yaml @@ -16,6 +16,7 @@ jobs: name: Promot from stage to prod uses: ./.github/workflows/promote.yaml with: - build-number: ${{ inputs.build-number }} + build-number: ${{ inputs.build-number }} target-repository: client-maven-stage-local target-branch: dev-stage + secrets: inherit diff --git a/.github/workflows/promote-to-stage.yaml b/.github/workflows/promote-to-stage.yaml index fe52abdf9..79318bfd7 100644 --- a/.github/workflows/promote-to-stage.yaml +++ b/.github/workflows/promote-to-stage.yaml @@ -20,14 +20,23 @@ jobs: env: JF_URL: ${{ vars.JFROG_PLATFORM_URL }} with: - oidc-provider-name: ${{ inputs.oidc-provider }} - oidc-audience: ${{ inputs.oidc-audience }} + oidc-provider-name: ${{ secrets.JFROG_OIDC_PROVIDER }} + oidc-audience: ${{ secrets.JFROG_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 + - name: Debug build-info run: | echo ${{ steps.get-build-info.outputs.build-info }} + + - name: Get commit hash + id: get-commit-hash + run: | + echo build-commit-hash=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo.vcs[].revision') >> $GITHUB_OUTPUT + + - name: Debug commit hash + run: | + echo ${{ steps.get-commit-hash.outputs.build-commit-hash }} diff --git a/.github/workflows/promote.yaml b/.github/workflows/promote.yaml index 302218397..f760d9fd0 100644 --- a/.github/workflows/promote.yaml +++ b/.github/workflows/promote.yaml @@ -25,8 +25,8 @@ jobs: env: JF_URL: ${{ vars.JFROG_PLATFORM_URL }} with: - oidc-provider-name: ${{ inputs.oidc-provider }} - oidc-audience: ${{ inputs.oidc-audience }} + oidc-provider-name: ${{ secrets.JFROG_OIDC_PROVIDER }} + oidc-audience: ${{ inputs.JFROG_OIDC_AUDIENCE }} - name: Get info id: get-build-info @@ -36,22 +36,16 @@ jobs: - 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 + echo commit-hash=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo.vcs[].revision') >> $GITHUB_OUTPUT - name: Debug run: | - echo ${{ steps.get-build-info.outputs.build-info }} - echo ${{ steps.get-build-info.outputs.build-name }} + echo ${{ steps.get-commit-hash.outputs.commit-hash }} - 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 }} + ref-to-merge: ${{ steps.get-commit-hash.outputs.commit-hash }} base-branch: ${{ inputs.target-branch }} git-bot-token: ${{ secrets.CLIENT_BOT_PAT }}