-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISPN-16536 Workflow publish test image. Replace Jenkins stage image
- Loading branch information
1 parent
4197a34
commit efeb437
Showing
1 changed file
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
name: CI Release Images | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
repository: | ||
description: 'Name of the repo to download server artifact from' | ||
type: string | ||
runId: | ||
description: 'Id of the run to download server artifact from' | ||
type: string | ||
serverArtifact: | ||
description: 'Artifact name to download' | ||
type: string | ||
tags: | ||
description: 'Tags for the image' | ||
type: string | ||
push: | ||
description: 'If true push image.' | ||
default: true | ||
type: boolean | ||
branch: | ||
description: 'infinispan-image branch to checkout.' | ||
default: main | ||
type: string | ||
secrets: | ||
token: | ||
required: true | ||
description: 'GH token' | ||
quayUser: | ||
required: true | ||
quayPass: | ||
required: true | ||
|
||
workflow_dispatch: | ||
inputs: | ||
repository: | ||
description: 'Name of the repo to download server artifact from' | ||
type: string | ||
runId: | ||
description: 'Id of the run to download server artifact from' | ||
type: string | ||
serverArtifact: | ||
description: 'Artifact name to download' | ||
type: string | ||
tags: | ||
description: 'Tags for the image' | ||
type: string | ||
push: | ||
description: 'If true push image.' | ||
default: true | ||
type: boolean | ||
branch: | ||
description: 'infinispan-image branch to checkout.' | ||
default: main | ||
type: string | ||
|
||
jobs: | ||
image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'infinispan/infinispan-images' | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Download Artifact | ||
uses: actions/[email protected] | ||
with: | ||
repository: '${{ inputs.repository }}' | ||
run-id: '${{ inputs.runId }}' | ||
name: '${{ inputs.serverArtifact }}' | ||
github-token: ${{ secrets.token }} | ||
|
||
- name: Unzip Artifact | ||
id: unzip_artifact | ||
run: | | ||
echo "serverzip=$(ls infinispan-server-*.zip)" >> $GITHUB_OUTPUT | ||
- name: Install CEKit | ||
uses: cekit/[email protected] | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Create Dockerfile | ||
env: | ||
SERVER_ZIP: ${{ steps.unzip_artifact.outputs.serverzip }} | ||
TAGS: ${{ inputs.tags }} | ||
run: | | ||
pwd | ||
ls | ||
SERVER_OVERRIDE="{\"artifacts\":[{\"name\":\"server\",\"path\":\"${GITHUB_WORKSPACE}/${SERVER_ZIP}\"}]}" | ||
TAG="${TAGS%%,*}" | ||
IMG_NAME="${TAG%%:*}" | ||
IMG_VER="${TAG##*:}" | ||
cekit -v --descriptor server-openjdk.yaml build --overrides '{"version": "'${IMG_VER}'", "name": "'${IMG_NAME}'"}' --overrides ${SERVER_OVERRIDE} --dry-run docker | ||
- name: Login to Quay | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.quayUser }} | ||
password: ${{ secrets.quayPass }} | ||
|
||
- name: Build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./target/image | ||
platforms: linux/amd64 | ||
pull: true | ||
push: ${{ inputs.push }} | ||
file: target/image/Dockerfile | ||
tags: ${{ inputs.tags }} | ||
load: true |