2022-01-12 08:06:10 +00:00
|
|
|
name: Keycloak Operator CI
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
env:
|
|
|
|
JDK_VERSION: 11
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
# Only run once for latest commit per ref and cancel other (previous) runs.
|
|
|
|
group: ci-operator-keycloak-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Update maven settings
|
|
|
|
run: mkdir -p ~/.m2 ; cp .github/settings.xml ~/.m2/
|
|
|
|
- uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: ${{ env.JDK_VERSION }}
|
|
|
|
- name: Cache Maven packages
|
|
|
|
id: cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.m2/repository
|
|
|
|
key: cache-1-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
|
|
|
restore-keys: cache-1-${{ runner.os }}-m2
|
|
|
|
|
|
|
|
- name: Create the Keycloak distribution
|
|
|
|
run: |
|
2022-02-11 11:55:57 +00:00
|
|
|
mvn clean install -Pdistribution -DskipTests -DskipExamples -DskipTestsuite
|
2022-01-12 08:06:10 +00:00
|
|
|
|
2022-02-03 08:38:45 +00:00
|
|
|
- name: Setup Minikube-Kubernetes
|
|
|
|
uses: manusa/actions-setup-minikube@v2.4.3
|
|
|
|
with:
|
|
|
|
minikube version: v1.24.0
|
|
|
|
kubernetes version: v1.22.3
|
|
|
|
github token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
driver: docker
|
2022-02-11 11:55:57 +00:00
|
|
|
|
|
|
|
- name: Build the Keycloak Docker image
|
|
|
|
run: |
|
|
|
|
cd quarkus
|
|
|
|
cp dist/target/keycloak-*.tar.gz container/
|
|
|
|
cd container
|
|
|
|
eval $(minikube -p minikube docker-env)
|
|
|
|
docker build --build-arg KEYCLOAK_DIST=$(ls keycloak-*.tar.gz) . -t keycloak:${GITHUB_SHA}
|
|
|
|
|
2022-02-16 11:26:04 +00:00
|
|
|
- name: Test operator running locally
|
|
|
|
working-directory: operator
|
|
|
|
run: |
|
|
|
|
mvn clean verify \
|
|
|
|
-Dquarkus.kubernetes.deployment-target=kubernetes \
|
|
|
|
-Doperator.keycloak.image=keycloak:${GITHUB_SHA} \
|
|
|
|
-Doperator.keycloak.image-pull-policy=Never
|
|
|
|
|
|
|
|
- name: Test operator running in cluster
|
|
|
|
working-directory: operator
|
2022-01-12 08:06:10 +00:00
|
|
|
run: |
|
2022-02-03 08:38:45 +00:00
|
|
|
eval $(minikube -p minikube docker-env)
|
|
|
|
mvn clean verify \
|
|
|
|
-Dquarkus.container-image.build=true -Dquarkus.container-image.tag=test \
|
|
|
|
-Dquarkus.kubernetes.deployment-target=kubernetes \
|
2022-02-11 11:55:57 +00:00
|
|
|
-Dquarkus.jib.jvm-arguments="-Djava.util.logging.manager=org.jboss.logmanager.LogManager","-Doperator.keycloak.image=keycloak:${GITHUB_SHA}","-Doperator.keycloak.image-pull-policy=Never" \
|
|
|
|
--no-transfer-progress -Dtest.operator.deployment=remote
|