Skip to content

Commit

Permalink
Integration fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzakaracic committed Dec 13, 2024
1 parent 1a9f6b4 commit 285014f
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .github/actions/build-and-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
26 changes: 11 additions & 15 deletions .github/actions/fast-forward-merge/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -15,21 +15,17 @@ inputs:
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 }}
run: git merge --ff-only ${{ inputs.ref-to-merge }}

- name: Add tagging message
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Promote to prod [skip ci]"
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
tagging_message: Promote to PROD
branch: ${{ inputs.base-branch }}

- name: Upload changes to remote head branch
shell: bash
Expand Down
24 changes: 18 additions & 6 deletions .github/actions/publish-to-jfrog/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ inputs:
default: https://aerospike.jfrog.io/
oidc-provider:
description: ""
required: false
default: gh-aerospike-clients
required: true
oidc-audience:
description: ""
required: false
default: aerospike/clients
required: true
crypto-type:
description: ""
required: false
Expand All @@ -38,15 +36,29 @@ runs:
oidc-provider-name: ${{ inputs.oidc-provider }}
oidc-audience: ${{ inputs.oidc-audience }}

- name: Debug
shell: bash
run: |
echo "${{ inputs.crypto-type }}" && \
ls -la
- name: Set crypto dependency
shell: bash
run: |
./set_crypto ${{ inputs.crypto-type }}
- name: Debug
shell: bash
run: |
echo "${{ inputs.crypto-type }}" && \
ls -la
- 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 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
6 changes: 6 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ on:
required: true
GPG_PASS:
required: true
JFROG_OIDC_PROVIDER:
required: true
JFROG_OIDC_AUDIENCE:
required: true

jobs:
build:
Expand Down Expand Up @@ -71,3 +75,5 @@ jobs:
uses: ./.github/actions/publish-to-jfrog
with:
crypto-type: ${{ inputs.crypto-type }}
oidc-provider: ${{ secrets.JFROG_OIDC_PROVIDER }}
oidc-audience: ${{ secrets.JFROG_OIDC_AUDIENCE }}
3 changes: 2 additions & 1 deletion .github/workflows/promote-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 14 additions & 3 deletions .github/workflows/promote-to-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,25 @@ 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: Get commit hash from repo
id: get-commit-hash
run: |
echo commit-hash=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo.vcs[].revision') >> $GITHUB_OUTPUT
- name: Get build name
id: get-build-name
run: |
echo build-name=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo.name') >> $GITHUB_OUTPUT
- name: Debug
run: |
echo ${{ steps.get-build-info.outputs.build-info }}
echo "commit-hash: '${{ steps.get-commit-hash.outputs.commit-hash }}'"
echo "build-name: '${{ steps.get-build-name.outputs.build-name }}'"
29 changes: 19 additions & 10 deletions .github/workflows/promote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:
inputs:
build-number:
type: number
type: string
description: Build number used to build artifact to be promoted
target-repository:
type: string
Expand All @@ -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: ${{ secrets.JFROG_OIDC_AUDIENCE }}

- name: Get info
id: get-build-info
Expand All @@ -36,25 +36,34 @@ 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
echo commit-hash=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo.vcs[].revision') >> $GITHUB_OUTPUT
- name: Get commit hash from repo
- name: Get build name
id: get-build-name
run: |
echo build-name=$(steps.get-build-info.outputs.build-info | jq -r '.name') >> $GITHUB_OUTPUT
echo build-name=$(echo '${{ steps.get-build-info.outputs.build-info }}' | jq -r '.buildInfo.name') >> $GITHUB_OUTPUT
- name: Debug
run: |
echo ${{ steps.get-build-info.outputs.build-info }}
echo ${{ steps.get-build-info.outputs.build-name }}
echo "commit-hash: '${{ steps.get-commit-hash.outputs.commit-hash }}'"
echo "build-name: '${{ steps.get-build-name.outputs.build-name }}'"
# Needed since we are using actions which are part of the repository
- 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: 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 }}

- name: Promote build
run: |
jf rt build-promote ${{ steps.get-build-info.outputs.build-name }} ${{ inputs.build-number }} ${{ inputs.target-repository }}
jf rt build-promote ${{ steps.get-build-name.outputs.build-name }} ${{ inputs.build-number }} ${{ inputs.target-repository }}

0 comments on commit 285014f

Please sign in to comment.