Skip to content

Commit

Permalink
Adding oidc integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzakaracic committed Nov 18, 2024
1 parent 84989c5 commit 6a1b221
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 28 deletions.
13 changes: 10 additions & 3 deletions .github/actions/upload-to-jfrog/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ inputs:
description: ""
required: false
default: https://aerospike.jfrog.io/
jfrog-token:
oidc-provider:
description: ""
required: true
required: false
default: gh-aerospike-clients
oidc-audience:
description: ""
required: false
default: aerospike/clients

runs:
using: "composite"
Expand All @@ -27,7 +32,9 @@ runs:
uses: jfrog/setup-jfrog-cli@v3
env:
JF_URL: ${{ inputs.jfrog-platform-url }}
JF_ACCESS_TOKEN: ${{ inputs.jfrog-token }}
with:
oidc-provider-name: ${{ inputs.oidc-provider }}
oidc-audience: ${{ inputs.oidc-audience }}

- name: Upload from branches to JFrog
shell: bash
Expand Down
22 changes: 22 additions & 0 deletions .github/actions/wait-for-as-server-to-start/action.yaml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 10 additions & 19 deletions .github/workflows/build-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
branch:
type: string
required: true
source-branch:
type: string
required: false
use-server-rc:
type: boolean
required: false
Expand Down Expand Up @@ -32,38 +35,26 @@ jobs:
- name: debug
run: |
echo "${{ inputs.branch }}"
echo "${{ github.ref }}"
echo "${{ github.base_ref }}"
build-java-21:
if: ${{ inputs.branch == 'refs/heads/stage' || inputs.branch == 'stage' }}
if: ${{ inputs.source-branch == 'refs/heads/stage' }}
uses: ./.github/workflows/build.yaml
strategy:
matrix:
java-version: [21]
include:
- java-version: 21
branch: "stage"
with:
java-version: ${{ matrix.java-version }}
branch: ${{ matrix.branch }}
java-version: 21
branch: ${{ inputs.branch }}
bump-version: ${{ inputs.bump-version }}
use-server-rc: ${{ inputs.use-server-rc }}
server-tag: ${{ inputs.server-tag }}
upload-artifacts: ${{ inputs.upload-artifacts }}
secrets: inherit

build-java-8:
if: ${{ inputs.branch == 'refs/heads/stage-jdk8' || inputs.branch == 'stage-jdk8' }}
if: ${{ inputs.source-branch == 'refs/heads/stage-jdk8' }}
uses: ./.github/workflows/build.yaml
strategy:
matrix:
java-version: [8]
include:
- java-version: 8
branch: "stage-jdk8"
with:
java-version: ${{ matrix.java-version }}
branch: ${{ matrix.branch }}
java-version: 8
branch: ${{ inputs.branch }}
bump-version: ${{ inputs.bump-version }}
use-server-rc: ${{ inputs.use-server-rc }}
server-tag: ${{ inputs.server-tag }}
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ on:
required: true
JFROG_DOCKER_TOKEN:
required: true
JFROG_MAVEN_TOKEN:
required: true

jobs:
build:
Expand All @@ -53,6 +51,11 @@ jobs:
distribution: "semeru" # See 'Supported distributions' for available options
java-version: ${{ inputs.java-version }}

- name: Debug, list files
run: |
ls -laR .github
echo "Checked out branch ${{ inputs.branch }}"
- name: Increment version
if: ${{ inputs.bump-version == true }}
run: |
Expand Down Expand Up @@ -95,4 +98,3 @@ jobs:
with:
version: ${{ steps.get-new-version.outputs.new_version }}
jdk-version: "jdk${{ inputs.java-version }}"
jfrog-token: ${{ secrets.JFROG_MAVEN_TOKEN }}
7 changes: 4 additions & 3 deletions .github/workflows/pull-request-open-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@ on:
- reopened
workflow_dispatch:
inputs:
branch:
source-branch:
type: string
default: stage
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-stage.yaml
with:
branch: ${{ github.base_ref || inputs.branch }}
branch: ${{ github.ref }}
source-branch: ${{ inputs.source-branch || github.base_ref }}
secrets: inherit

test-with-server-rc:
name: Build stage - Test with latest RC version of Aerospike Enterprise Server
uses: ./.github/workflows/build-stage.yaml
with:
branch: ${{ github.base_ref || inputs.branch }}
source-branch: ${{ inputs.source-branch || github.base_ref }}
use-server-rc: true
secrets: inherit

0 comments on commit 6a1b221

Please sign in to comment.