keycloak-scim/operator/app/scripts/prepare-olm-test.sh

35 lines
1.2 KiB
Bash
Raw Normal View History

#! /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:-""}
OPERATOR_IMAGE_NAME="keycloak-operator"
2022-04-12 09:19:24 +00:00
OPERATOR_DOCKER_IMAGE="$DOCKER_REGISTRY/${UUID}$OPERATOR_IMAGE_NAME"
# 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)
# 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
# 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
(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)
# Create testing resources
2022-04-12 09:19:24 +00:00
$SCRIPT_DIR/create-olm-test-resources.sh $VERSION $DOCKER_REGISTRY ${UUID}