mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Nightly CI and Operator Setup script (#4958)
* Nightly CI and Operator Setup script * Fix syntax error * Addressed review comment * Update changelog and few review comment
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
|
||||
### Tests
|
||||
|
||||
- runs nightly test of main branch of odo against [SBO master branch](https://github.com/redhat-developer/service-binding-operator) ([4942](https://github.com/openshift/odo/issues/4942))
|
||||
|
||||
### Documentation
|
||||
|
||||
## 2.2.x
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
export SBO_CATALOG_SOURCE="redhat-operators"
|
||||
export SBO_SUBSCRIPTION_NAME="rh-service-binding-operator"
|
||||
|
||||
install_redis_operator(){
|
||||
$1 create -f - <<EOF
|
||||
apiVersion: operators.coreos.com/v1alpha1
|
||||
@@ -31,13 +34,40 @@ install_service_binding_operator(){
|
||||
EOF
|
||||
}
|
||||
|
||||
deploy_service_binding_operator_master(){
|
||||
oc create -f - <<EOF
|
||||
apiVersion: operators.coreos.com/v1alpha1
|
||||
kind: CatalogSource
|
||||
metadata:
|
||||
name: $1
|
||||
namespace: openshift-marketplace
|
||||
spec:
|
||||
displayName: Service Binding Operator build from master
|
||||
image: quay.io/redhat-developer/servicebinding-operator:index
|
||||
priority: 500
|
||||
publisher: Red Hat
|
||||
sourceType: grpc
|
||||
updateStrategy:
|
||||
registryPoll:
|
||||
interval: 10m0s
|
||||
EOF
|
||||
}
|
||||
|
||||
if [ $KUBERNETES == "true" ]; then
|
||||
# install "redis-oprator" using "kubectl" in "operators" namespace; use "operatorhubio-catalog" catalog source from "olm" namespace
|
||||
install_redis_operator kubectl operators operatorhubio-catalog olm
|
||||
else
|
||||
if [ $NIGHTLY == "true" ]; then
|
||||
SBO_CATALOG_SOURCE="service-binding-master"
|
||||
SBO_SUBSCRIPTION_NAME="service-binding-operator"
|
||||
|
||||
# Deploy SBO master catalog source on OCP Nightly test run
|
||||
deploy_service_binding_operator_master $SBO_CATALOG_SOURCE
|
||||
fi
|
||||
|
||||
# install "redis-oprator" using "oc" in "openshift-operators" namespace; use "community-operators" catalog source from "openshift-marketplace" namespace
|
||||
install_redis_operator oc openshift-operators community-operators openshift-marketplace
|
||||
|
||||
# install "service-binding-operator" using "oc" in "openshift-operators" namespace; use "redhat-operators" catalog source from "openshift-marketplace" namespace
|
||||
install_service_binding_operator oc openshift-operators rh-service-binding-operator redhat-operators openshift-marketplace
|
||||
# install "service-binding-operator" using "oc" in "openshift-operators" namespace; use SBO_CATALOG_SOURCE env var catalog source from "openshift-marketplace" namespace
|
||||
install_service_binding_operator oc openshift-operators $SBO_SUBSCRIPTION_NAME $SBO_CATALOG_SOURCE openshift-marketplace
|
||||
fi
|
||||
35
scripts/openshiftci-Nightly-SBO-tests.sh
Executable file
35
scripts/openshiftci-Nightly-SBO-tests.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
# fail if some commands fails
|
||||
set -e
|
||||
# show commands
|
||||
set -x
|
||||
|
||||
export CI="openshift"
|
||||
export NIGHTLY=true
|
||||
make configure-installer-tests-cluster
|
||||
make bin
|
||||
mkdir -p $GOPATH/bin
|
||||
make goget-ginkgo
|
||||
export PATH="$PATH:$(pwd):$GOPATH/bin"
|
||||
export CUSTOM_HOMEDIR=$ARTIFACT_DIR
|
||||
|
||||
# Copy kubeconfig to temporary kubeconfig file
|
||||
# Read and Write permission to temporary kubeconfig file
|
||||
TMP_DIR=$(mktemp -d)
|
||||
cp $KUBECONFIG $TMP_DIR/kubeconfig
|
||||
chmod 640 $TMP_DIR/kubeconfig
|
||||
export KUBECONFIG=$TMP_DIR/kubeconfig
|
||||
|
||||
# Login as developer
|
||||
oc login -u developer -p password@123
|
||||
|
||||
# Check login user name for debugging purpose
|
||||
oc whoami
|
||||
|
||||
# Operatorhub integration tests
|
||||
make test-operator-hub
|
||||
|
||||
cp -r reports $ARTIFACT_DIR
|
||||
|
||||
oc logout
|
||||
Reference in New Issue
Block a user