2022-04-08 08:22:01 +00:00
|
|
|
#! /bin/bash
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
|
|
|
|
|
|
DOCKER_REGISTRY="$1"
|
|
|
|
|
|
|
|
VERSION="$2"
|
|
|
|
PREV_VERSION="$3"
|
|
|
|
|
2022-04-12 09:19:24 +00:00
|
|
|
UUID=${4:-""}
|
|
|
|
|
2023-09-19 17:46:37 +00:00
|
|
|
TARGET_NAMESPACES=${5-default}
|
|
|
|
|
2022-04-08 08:22:01 +00:00
|
|
|
OPERATOR_IMAGE_NAME="keycloak-operator"
|
2022-04-12 09:19:24 +00:00
|
|
|
OPERATOR_DOCKER_IMAGE="$DOCKER_REGISTRY/${UUID}$OPERATOR_IMAGE_NAME"
|
2022-04-08 08:22:01 +00:00
|
|
|
|
|
|
|
# Create OLM bundle
|
|
|
|
$SCRIPT_DIR/create-olm-bundle.sh $VERSION $PREV_VERSION $OPERATOR_DOCKER_IMAGE
|
|
|
|
|
|
|
|
(cd $SCRIPT_DIR/../olm/$VERSION && \
|
2022-04-12 09:19:24 +00:00
|
|
|
docker build -t $DOCKER_REGISTRY/${UUID}keycloak-operator-bundle:$VERSION -f bundle.Dockerfile . && \
|
|
|
|
docker push $DOCKER_REGISTRY/${UUID}keycloak-operator-bundle:$VERSION)
|
2022-04-08 08:22:01 +00:00
|
|
|
|
|
|
|
# Verify the bundle
|
2022-04-12 09:19:24 +00:00
|
|
|
opm alpha bundle validate --tag $DOCKER_REGISTRY/${UUID}keycloak-operator-bundle:$VERSION --image-builder docker
|
2022-04-08 08:22:01 +00:00
|
|
|
|
|
|
|
# Create the test-catalog
|
2022-04-12 09:19:24 +00:00
|
|
|
$SCRIPT_DIR/create-olm-test-catalog.sh $VERSION $DOCKER_REGISTRY/${UUID}keycloak-operator-bundle
|
2022-04-08 08:22:01 +00:00
|
|
|
|
|
|
|
(cd $SCRIPT_DIR/../olm/catalog && \
|
2022-04-12 09:19:24 +00:00
|
|
|
docker build -f test-catalog.Dockerfile -t $DOCKER_REGISTRY/${UUID}keycloak-test-catalog:$VERSION . && \
|
|
|
|
docker push $DOCKER_REGISTRY/${UUID}keycloak-test-catalog:$VERSION)
|
2022-04-08 08:22:01 +00:00
|
|
|
|
|
|
|
# Create testing resources
|
2023-09-19 17:46:37 +00:00
|
|
|
$SCRIPT_DIR/create-olm-test-resources.sh $VERSION $DOCKER_REGISTRY ${UUID} $TARGET_NAMESPACES
|