keycloak-scim/operator/scripts/create-olm-test-resources.sh
Andrea Peruffo 7816e69e38
Build the Olm bundle and test it in CI (#10949)
* Building the OLM bundle

* kustomize the main CRD for the OLM bundle

* minor fixes
2022-04-08 10:22:01 +02:00

55 lines
1.3 KiB
Bash
Executable file

#! /bin/bash
set -euxo pipefail
VERSION=$1
DOCKER_REGISTRY=$2
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
rm -rf $SCRIPT_DIR/../olm/testing-resources
mkdir -p $SCRIPT_DIR/../olm/testing-resources
cat << EOF >> $SCRIPT_DIR/../olm/testing-resources/catalog.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: test-catalog
namespace: default
spec:
sourceType: grpc
image: $DOCKER_REGISTRY/keycloak-test-catalog:$VERSION
displayName: Keycloak Test Catalog
publisher: Me
updateStrategy:
registryPoll:
interval: 10m
EOF
cat << EOF >> $SCRIPT_DIR/../olm/testing-resources/operatorgroup.yaml
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
name: og-single
namespace: default
spec:
targetNamespaces:
- default
EOF
cat << EOF >> $SCRIPT_DIR/../olm/testing-resources/subscription.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: keycloak-operator
namespace: default
spec:
installPlanApproval: Automatic
name: keycloak-operator
source: test-catalog
sourceNamespace: default
startingCSV: keycloak-operator.v$VERSION
config:
env:
- name: "OPERATOR_KEYCLOAK_IMAGE"
value: "$DOCKER_REGISTRY/keycloak:$VERSION"
EOF