Skip to content

Commit

Permalink
Integration fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzakaracic committed Feb 15, 2025
1 parent 5f3a506 commit e9fb5fb
Show file tree
Hide file tree
Showing 40 changed files with 1,577 additions and 215 deletions.
22 changes: 12 additions & 10 deletions .github/actions/build-and-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,42 @@ inputs:
required: false
default: "latest"
description: "Server docker image tag"
jfrog_docker_username:
oidc-provider:
required: true
description: ""
jfrog_docker_token:
oidc-audience:
required: true
description: ""
run-tests:
required: true
default: "false"
default: "true"
description: Spin up aerospike enterprise server and run tests

runs:
using: "composite"
steps:
# Using script to set profile since we would like to have the sticky effect. Set it once and have it
# remain for remainder of the job
- 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
- name: Run Aerospike
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 }}
oidc-provider: ${{ inputs.oidc-provider }}
oidc-audience: ${{ inputs.oidc-audience }}

- name: Test
- name: Run tests
shell: bash
if: ${{ inputs.run-tests == true }}
if: ${{ inputs.run-tests == 'true' }}
working-directory: test
run: mvn test -DskipTests=false
36 changes: 0 additions & 36 deletions .github/actions/fast-forward-merge/action.yaml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/actions/github-release/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Create github release
description: Creates a github release

inputs:
artifact-version:
description: ""
required: true
github-token:
description: ""
required: true

runs:
using: composite
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get previous tag
shell: bash
id: get-prev-tag
run: |
# Fetch all tags
git fetch --tags
echo "previous-tag=$(git tag --sort=-creatordate | sed -n '1p')" >> $GITHUB_OUTPUT
# Extract commit messages between previous tag and the current tag.
- name: Get release notes
shell: bash
id: release-notes
run: |
notes=$(git log "${{ steps.get-previous-tag.outputs.previous-tag }}..HEAD" --pretty=format:"%s" --no-merges)
# GitHub Actions requires that multiline output is escaped:
notes="${notes//'%'/'%25'}"
notes="${notes//$'\n'/'%0A'}"
notes="${notes//$'\r'/'%0D'}"
echo "notes=$notes" >> $GITHUB_OUTPUT
- name: Debug
shell: bash
run: |
echo "artifact-version: ${{ inputs.artifact-version }}"
echo "body: ${{ steps.release-notes.outputs.notes }}"
- uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
tag: ${{ inputs.artifact-version }}
tag_exists_error: false
message: "Latest release"
60 changes: 60 additions & 0 deletions .github/actions/publish-build-info-to-jfrog/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish build-info to JFrog
description: "Publishes build-info to JFrog"

inputs:
jfrog-platform-url:
description: ""
required: false
default: https://aerospike.jfrog.io
oidc-provider:
description: ""
required: true
oidc-audience:
description: ""
required: true
build-path:
description: ""
required: true
variables:
description: ""
required: true

runs:
using: "composite"
steps:
- name: Debug publish to github
shell: bash
run: |
echo "${{ inputs.jfrog-platform-url }}"
echo "${{ inputs.build-path }}"
- name: Set up JFrog credentials
id: setup-jfrog-cli
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ inputs.jfrog-platform-url }}
with:
version: 2.72.2
oidc-provider-name: ${{ inputs.oidc-provider }}
oidc-audience: ${{ inputs.oidc-audience }}

- name: Set env variables provided with variables
shell: bash
run: |
ENV_VARIABLES='${{ inputs.variables }}'
echo "$ENV_VARIABLES" | jq -r 'to_entries | .[] | "\(.key)=\(.value)"' >> $GITHUB_ENV
- name: Upload artifacts
shell: bash
run: |
BUILD_ID=$(echo "${{ inputs.build-path }}" | sed 's/.*_\(.*\)\/.*/\1/')
BUILD_PATH="promote_${BUILD_ID}"
# record env variables
jf rt bce ${BUILD_PATH} ${{ github.run_number }}
# record git info
jf rt bag ${BUILD_PATH} ${{ github.run_number }}
# publish build info
jf rt bp ${BUILD_PATH} ${{ github.run_number }}
81 changes: 81 additions & 0 deletions .github/actions/publish-to-github/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Publish artifacts to github
description: "Publish artifacts to github"

inputs:
staging-folder:
description: ""
required: false
default: staging
target-folder:
description: ""
required: false
default: github
release-notes:
description: ""
required: true
github-token:
description: ""
required: true
artifact-version:
description: ""
required: true

runs:
using: "composite"
steps:
- name: Debug publish to github
shell: bash
run: |
echo "${{ inputs.staging-folder }}"
echo "${{ inputs.target-folder }}"
echo "${{ inputs.artifact-version }}"
echo "${{ inputs.release-notes }}"
- name: Create upload archive for github
id: create-artifact
shell: bash
run: |
src="${{ inputs.staging-folder }}"
dest="${{ inputs.target-folder }}"
find "$src" -type f \
-exec cp {} "$dest" \;
- id: get-github-release-artifact-names
working-directory: ${{ inputs.target-folder }}
shell: bash
run: |
ARTIFACTS=$(ls -l)
echo "release-artifacts<<EOF" >> $GITHUB_OUTPUT
echo "${ARTIFACTS}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Debug show content of the upload archive
shell: bash
run: |
pwd
ls -laR "${{ inputs.target-folder }}"
- name: Debug GitHub publish input
shell: bash
working-directory: ${{ inputs.target-folder }}
run: |
echo "workind directory: ${{ inputs.target-folder }}"
echo "tag name: Release ${{ inputs.artifact-version }}"
echo "body: Changes for release ${{ inputs.artifact-version }}"
echo "body: ${{ inputs.release-notes }}"
echo "files: ${{ steps.get-github-release-artifact-names.outputs.release-artifacts }}"
#- name: Publish release to github
# working-directory: ${{ inputs.target-folder }}
# uses: softprops/action-gh-release@v2
# with:
# token: ${{ inputs.github-token }}
# tag_name: Release ${{ inputs.artifact-version }}
# body: |
# Changes for release ${{ inputs.artifact-version }}
# "${{ inputs.release-notes }}"
# draft: false
# prerelease: false
# files: ${{ steps.get-github-release-artifact-names.outputs.release-artifacts }}
80 changes: 68 additions & 12 deletions .github/actions/publish-to-jfrog/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,96 @@ inputs:
jfrog-platform-url:
description: ""
required: false
default: https://aerospike.jfrog.io/
default: https://aerospike.jfrog.io
oidc-provider:
description: ""
required: false
default: gh-aerospike-clients
required: true
oidc-audience:
description: ""
required: true
artifact-id:
description: ""
required: true
artifact-version:
description: ""
required: true
deploy-spec-path:
description: ""
required: false
default: aerospike/clients
crypto-type:
default: deploy-resources
package-install-location:
description: ""
required: false
default: gnu
default: ~/.m2/repository

runs:
using: "composite"
steps:
- name: Debug publish to github
shell: bash
run: |
echo "${{ inputs.jfrog-releases-repo-name }}/github"
echo "${{ inputs.jfrog-snapshots-repo-name }}"
echo "${{ inputs.jfrog-platform-url }}"
echo "${{ inputs.artifact-id }}"
echo "${{ inputs.artifact-version }}"
echo "${{ inputs.deploy-spec-path }}"
echo "${{ inputs.package-install-location }}"
- name: Set up JFrog credentials
id: setup-jfrog-cli
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ inputs.jfrog-platform-url }}
with:
version: 2.72.2
oidc-provider-name: ${{ inputs.oidc-provider }}
oidc-audience: ${{ inputs.oidc-audience }}

- name: Set crypto dependency
- name: Configure jf cli
shell: bash
run: |
jf mvn-config \
--repo-deploy-releases=${{ inputs.jfrog-releases-repo-name }} \
--repo-deploy-snapshots=${{ inputs.jfrog-snapshots-repo-name }}
- name: Generate deploy spec
shell: bash
working-directory: client
run: |
./set_crypto ${{ inputs.crypto-type }}
jq --arg targetPattern "${{ inputs.jfrog-releases-repo-name }}/com/aerospike/${{ inputs.artifact-id }}/${{ inputs.artifact-version }}/" \
--arg publicPomPattern "${{ inputs.package-install-location }}/com/aerospike/${{ inputs.artifact-id }}/${{ inputs.artifact-version }}/*.pom" \
--arg jarPattern "${{ inputs.package-install-location }}/com/aerospike/${{ inputs.artifact-id }}/${{ inputs.artifact-version }}/*.jar" \
--arg ascPattern "${{ inputs.package-install-location }}/com/aerospike/${{ inputs.artifact-id }}/${{ inputs.artifact-version }}/*.asc" \
'
.files[0].pattern = $jarPattern |
.files[0].target = $targetPattern |
.files[1].pattern = $ascPattern |
.files[1].target = $targetPattern |
.files[2].pattern = $publicPomPattern |
.files[2].target = $targetPattern
' ${{ inputs.deploy-spec-path }}/publish-spec.json.template > ${{ inputs.deploy-spec-path }}/publish-spec.json
- name: Deploy release
- name: Debug deploy spec
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
cat ${{ inputs.deploy-spec-path }}/publish-spec.json
- name: Upload artifacts
shell: bash
working-directory: client
run: |
jf rt upload --spec=${{ inputs.deploy-spec-path }}/publish-spec.json \
--module=${{ inputs.artifact-id }} \
--build-name=clients-java-push-to-dev_${{ inputs.artifact-id }} \
--build-number=${{ github.run_number }}
# record env variables
jf rt bce clients-java-push-to-dev_${{ inputs.artifact-id }} ${{ github.run_number }}
# record git info
jf rt bag clients-java-push-to-dev_${{ inputs.artifact-id }} ${{ github.run_number }}
# publish build info
jf rt bp clients-java-push-to-dev_${{ inputs.artifact-id }} ${{ github.run_number }}
Loading

0 comments on commit e9fb5fb

Please sign in to comment.