Skip to content

Commit

Permalink
feat(image): productionize the keycloak image
Browse files Browse the repository at this point in the history
- Integration tests added for AWS with IRSA and ARM.
- Linting added to the repository.
- Automatic image publishing on DockerHub.
- Multi-architecture images.
- New README file.
  • Loading branch information
leiicamundi authored Mar 15, 2024
1 parent 5e7f5b6 commit 6a15db2
Show file tree
Hide file tree
Showing 24 changed files with 1,236 additions and 137 deletions.
7 changes: 7 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
self-hosted-runner:
# Labels of self-hosted runner in array of string
labels:
- aws-arm-core-2-default
- aws-core-2-default
- gcp-core-2-default
34 changes: 17 additions & 17 deletions .github/actions/compose/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ inputs:
runs:
using: composite
steps:
- name: Run ${{ inputs.project_name }} compose
uses: isbang/[email protected]
with:
compose-file: |
${{ inputs.compose_file }}
compose-flags: "--project-name ${{ inputs.project_name }}"
- name: Short sleep to let it startup
shell: bash
run: sleep 3
- name: Check if service is healthy
shell: bash
run: |
${{ github.action_path }}/healthy.sh
env:
FILE: ${{ inputs.compose_file }}
TIMEOUT: "300"
COMPOSE_FLAGS: "--project-name ${{ inputs.project_name }}"
- name: Run ${{ inputs.project_name }} compose
uses: isbang/compose-action@178aeba5c9dbeed89ffffbb3e6548ec08e9839cf # v1.5.1
with:
compose-file: |
${{ inputs.compose_file }}
compose-flags: "--project-name ${{ inputs.project_name }}"
- name: Short sleep to let it startup
shell: bash
run: sleep 3
- name: Check if service is healthy
shell: bash
run: |
${{ github.action_path }}/healthy.sh
env:
FILE: ${{ inputs.compose_file }}
TIMEOUT: "300"
COMPOSE_FLAGS: "--project-name ${{ inputs.project_name }}"
5 changes: 5 additions & 0 deletions .github/actions/compose/healthy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ while [ $(date +%s) -lt $endTime ]; do
fi
done <<< $(eval $DOCKER_COMMAND ps --format json | jq -n '[inputs] | flatten | .[].Status')
echo -en "\rWaiting for services... $cnt/$(eval $DOCKER_COMMAND ps --format json | jq -n '[inputs] | flatten | .[].Status' | wc -l)"

# see what happens
eval $DOCKER_COMMAND ps
eval $DOCKER_COMMAND logs

if [[ $cnt -eq $(eval $DOCKER_COMMAND ps --format json | jq -n '[inputs] | flatten | .[].Status' | wc -l) ]]; then
echo ""
exit 0
Expand Down
46 changes: 38 additions & 8 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,18 +1,48 @@
{
extends: [
"extends": [
"config:recommended",
"docker:enableMajor",
":dependencyDashboard",
":semanticCommits"
":semanticCommits",
":docker"
],
automerge: false,
regexManagers: [
"automerge": false,
"packageRules": [
{
fileMatch: ["build.gradle$"],
matchStrings: [
"matchManagers": ["dockerfile"],
"groupName": "new major keycloak available",
"groupSlug": "new-major-keycloak",
"matchDatasources": ["docker"],
"matchFileNames": [".watch-latest/Dockerfile"],
"matchUpdateTypes": ["major"],
"enabled": true,
"addLabels": ["dependencies", "docker"]
},
{
"matchManagers": ["dockerfile"],
"groupName": "all non-major keycloak",
"groupSlug": "all-non-major-keycloak",
"matchDatasources": ["docker"],
"matchFileNames": ["keycloak-*/Dockerfile"],
"matchUpdateTypes": ["minor", "patch", "digest", "pin", "pinDigest"],
"enabled": true,
"addLabels": ["dependencies", "docker"]
},
{
"matchManagers": ["dockerfile"],
"matchDatasources": ["docker"],
"matchFileNames": ["keycloak-*/Dockerfile"],
"matchUpdateTypes": ["major"],
"enabled": false
}
],
"customManagers": [
{
"customType": "regex",
"fileMatch": ["build.gradle$"],
"matchStrings": [
"renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s.* (?<currentValue>.*)\\s"
],
versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
}
]
}
8 changes: 8 additions & 0 deletions .github/scripts/utils/find_latest_keycloak.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

#!/usr/bin/env bash

# Script: find_latest_keycloak.sh
# Description: Finds the latest version of Keycloak from folders prefixed with "keycloak-" in the current directory.
# Usage: find_latest_keycloak.sh

ls -1d --color=never "$(pwd)"/keycloak-* | tail -n 1 | awk -F'[-/]' '{print $(NF-0)}'
Loading

0 comments on commit 6a15db2

Please sign in to comment.