2022-01-12 08:06:10 +00:00
|
|
|
name: Keycloak Operator CI
|
|
|
|
|
2022-03-29 13:10:20 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore: [main]
|
|
|
|
pull_request:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * *'
|
2022-01-12 08:06:10 +00:00
|
|
|
|
|
|
|
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
|
2022-03-29 13:10:20 +00:00
|
|
|
if: ${{ ( github.event_name != 'schedule' ) || ( github.event_name == 'schedule' && github.repository == 'keycloak/keycloak' ) }}
|
2022-01-12 08:06:10 +00:00
|
|
|
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-03-09 13:25:18 +00:00
|
|
|
start args: '--addons=ingress'
|
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} \
|
2022-03-09 13:25:18 +00:00
|
|
|
-Doperator.keycloak.image-pull-policy=Never \
|
|
|
|
-Dtest.operator.kubernetes.ip=$(minikube ip)
|
2022-02-16 11:26:04 +00:00
|
|
|
|
|
|
|
- name: Test operator running in cluster
|
|
|
|
working-directory: operator
|
2022-01-12 08:06:10 +00:00
|
|
|
run: |
|
2022-02-08 14:13:58 +00:00
|
|
|
eval $(minikube -p minikube docker-env)
|
2022-02-03 08:38:45 +00:00
|
|
|
mvn clean verify \
|
|
|
|
-Dquarkus.container-image.build=true -Dquarkus.container-image.tag=test \
|
|
|
|
-Dquarkus.kubernetes.deployment-target=kubernetes \
|
2022-02-25 14:29:01 +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" \
|
2022-03-09 13:25:18 +00:00
|
|
|
--no-transfer-progress -Dtest.operator.deployment=remote \
|
|
|
|
-Dtest.operator.kubernetes.ip=$(minikube ip)
|