2022-04-12 09:19:24 +00:00
|
|
|
#! /bin/bash
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
UUID=${1:-$(git rev-parse --short HEAD)}
|
|
|
|
|
2023-09-19 17:46:37 +00:00
|
|
|
INSTALL_NAMESPACE=${2:-default}
|
|
|
|
|
|
|
|
TARGET_NAMESPACES=${3-$INSTALL_NAMESPACE}
|
|
|
|
|
2022-04-12 09:19:24 +00:00
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
|
|
|
|
|
|
# This version translates to one day for ttl.sh
|
|
|
|
VERSION="86400000.0.0"
|
|
|
|
|
|
|
|
# Build Keycloak Docker image (the keycloak tar.gz should already be in the container folder)
|
|
|
|
(
|
2022-06-27 15:54:45 +00:00
|
|
|
cd $SCRIPT_DIR/../../quarkus/container
|
2022-04-12 09:19:24 +00:00
|
|
|
|
|
|
|
docker build --build-arg KEYCLOAK_DIST=$(ls keycloak-*.tar.gz) . -t "ttl.sh/${UUID}keycloak:${VERSION}"
|
|
|
|
docker push "ttl.sh/${UUID}keycloak:${VERSION}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# Build the operator Docker image
|
|
|
|
(
|
2022-06-27 15:54:45 +00:00
|
|
|
cd $SCRIPT_DIR/../../
|
2022-05-30 13:36:49 +00:00
|
|
|
mvn clean package -Poperator -pl :keycloak-operator -am \
|
2022-04-12 09:19:24 +00:00
|
|
|
-Dquarkus.container-image.build=true \
|
|
|
|
-Dquarkus.container-image.image="ttl.sh/${UUID}keycloak-operator:${VERSION}" \
|
2022-04-20 09:09:08 +00:00
|
|
|
-Doperator.keycloak.image="ttl.sh/${UUID}keycloak:${VERSION}" \
|
2022-04-12 09:19:24 +00:00
|
|
|
-DskipTests
|
|
|
|
# JIB patching on images doesn't work reliably with ttl.sh
|
|
|
|
docker push "ttl.sh/${UUID}keycloak-operator:${VERSION}"
|
|
|
|
)
|
|
|
|
|
2023-09-19 17:46:37 +00:00
|
|
|
$SCRIPT_DIR/prepare-olm-test.sh ttl.sh ${VERSION} NONE ${UUID} $TARGET_NAMESPACES
|
2022-04-12 09:19:24 +00:00
|
|
|
|
2023-09-19 17:46:37 +00:00
|
|
|
$SCRIPT_DIR/install-keycloak-operator.sh $INSTALL_NAMESPACE
|