-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(e2e): automate E2E scenario with use of Operator for installati…
…on refactored
- Loading branch information
1 parent
be380af
commit 361ec25
Showing
12 changed files
with
175 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,66 @@ | ||
#!/bin/sh | ||
|
||
install_rhdh_operator() { | ||
local dir=$1 | ||
local namespace=$2 | ||
|
||
configure_namespace $namespace | ||
|
||
# Make sure script is up to date | ||
rm -f /tmp/install-rhdh-catalog-source.sh | ||
curl -L https://raw.githubusercontent.com/redhat-developer/rhdh-operator/refs/heads/main/.rhdh/scripts/install-rhdh-catalog-source.sh > /tmp/install-rhdh-catalog-source.sh | ||
chmod +x /tmp/install-rhdh-catalog-source.sh | ||
bash -x /tmp/install-rhdh-catalog-source.sh --next --install-operator rhdh | ||
|
||
# Wait for Operator to finish unpacking | ||
sleep 30 | ||
} | ||
|
||
deploy_rhdh_operator() { | ||
local dir=$1 | ||
local namespace=$2 | ||
|
||
if [[ "${namespace}" == "showcase-op-rbac-nightly" ]]; then | ||
oc apply -f "${dir}/resources/rhdh-operator/rhdh-start-rbac.yaml" -n "${namespace}" | ||
else | ||
oc apply -f "${dir}/resources/rhdh-operator/rhdh-start.yaml" -n "${namespace}" | ||
fi | ||
} | ||
|
||
initiate_operator_deployments() { | ||
configure_namespace "${OPERATOR_MANAGER}" | ||
install_rhdh_operator "${DIR}" "${OPERATOR_MANAGER}" | ||
|
||
local rhdh_base_url="https://backstage-${RELEASE_NAME}-${NAME_SPACE}.${K8S_CLUSTER_ROUTER_BASE}" | ||
apply_yaml_files "${DIR}" "${NAME_SPACE}" "${rhdh_base_url}" | ||
create_dynamic_plugins_config "${DIR}/value_files/${HELM_CHART_VALUE_FILE_NAME}" "/tmp/configmap-dynamic-plugins.yaml" | ||
oc apply -f /tmp/configmap-dynamic-plugins.yaml -n "${NAME_SPACE}" | ||
oc apply -f "$DIR/resources/redis-cache/redis-deployment.yaml" --namespace="${NAME_SPACE}" | ||
deploy_rhdh_operator "${DIR}" "${NAME_SPACE}" | ||
|
||
local rbac_rhdh_base_url="https://backstage-${RELEASE_NAME_RBAC}-${NAME_SPACE_RBAC}.${K8S_CLUSTER_ROUTER_BASE}" | ||
apply_yaml_files "${DIR}" "${NAME_SPACE_RBAC}" "${rbac_rhdh_base_url}" | ||
create_dynamic_plugins_config "${DIR}/value_files/${HELM_CHART_RBAC_VALUE_FILE_NAME}" "/tmp/configmap-dynamic-plugins-rbac.yaml" | ||
oc apply -f /tmp/configmap-dynamic-plugins-rbac.yaml -n "${NAME_SPACE_RBAC}" | ||
deploy_rhdh_operator "${DIR}" "${NAME_SPACE_RBAC}" | ||
} | ||
|
||
handle_operator() { | ||
oc_login | ||
|
||
apply_yaml_files "${DIR}" "${NAME_SPACE}" | ||
API_SERVER_URL=$(oc whoami --show-server) | ||
ENCODED_API_SERVER_URL=$(echo "${API_SERVER_URL}" | base64) | ||
ENCODED_CLUSTER_NAME=$(echo "my-cluster" | base64) | ||
|
||
export K8S_CLUSTER_ROUTER_BASE=$(oc get route console -n openshift-console -o=jsonpath='{.spec.host}' | sed 's/^[^.]*\.//') | ||
local url="https://backstage-${RELEASE_NAME}-${NAME_SPACE}.${K8S_CLUSTER_ROUTER_BASE}" | ||
local rbac_url="https://backstage-${RELEASE_NAME_RBAC}-${NAME_SPACE_RBAC}.${K8S_CLUSTER_ROUTER_BASE}" | ||
|
||
configure_namespace "${NAME_SPACE}" | ||
configure_namespace "${NAME_SPACE_RBAC}" | ||
deploy_test_backstage_provider "${NAME_SPACE}" | ||
cluster_setup | ||
initiate_operator_deployments | ||
check_and_test "${RELEASE_NAME}" "${NAME_SPACE}" "${url}" | ||
check_and_test "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC}" "${rbac_url}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
.ibm/pipelines/resources/config_map/app-config-rhdh-rbac.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
.ibm/pipelines/resources/rhdh-operator/rhdh-start-rbac.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
kind: Backstage | ||
apiVersion: rhdh.redhat.com/v1alpha2 | ||
metadata: | ||
name: rhdh-rbac | ||
spec: | ||
application: | ||
image: 'quay.io/rhdh/rhdh-hub-rhel9:next' | ||
appConfig: | ||
configMaps: | ||
- name: app-config-rhdh | ||
mountPath: /opt/app-root/src | ||
dynamicPluginsConfigMapName: dynamic-plugins | ||
extraEnvs: | ||
secrets: | ||
- name: rhdh-secrets | ||
extraFiles: | ||
configMaps: | ||
- name: rbac-policy | ||
mountPath: /opt/app-root/src/rbac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
kind: Backstage | ||
apiVersion: rhdh.redhat.com/v1alpha2 | ||
metadata: | ||
name: rhdh | ||
spec: | ||
application: | ||
image: 'quay.io/rhdh/rhdh-hub-rhel9:next' | ||
appConfig: | ||
configMaps: | ||
- name: app-config-rhdh | ||
- name: dynamic-homepage-and-sidebar-config | ||
mountPath: /opt/app-root/src | ||
dynamicPluginsConfigMapName: dynamic-plugins | ||
extraEnvs: | ||
secrets: | ||
- name: rhdh-secrets | ||
- name: redis-secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters