diff --git a/dev/env/scripts/up.sh b/dev/env/scripts/up.sh index 2541ec327..62015dcc2 100755 --- a/dev/env/scripts/up.sh +++ b/dev/env/scripts/up.sh @@ -36,12 +36,6 @@ if [[ -d "${MANIFESTS_DIR}/cluster-type-${CLUSTER_TYPE}" ]]; then apply "${MANIFESTS_DIR}/cluster-type-${CLUSTER_TYPE}" fi -# Deploy database. -log "Deploying database" -make -C "$GITROOT" deploy/db -wait_for_container_to_become_ready "$ACSCS_NAMESPACE" "application=fleet-manager-db" "postgresql" -log "Database is ready." - # Deploy Cloud Service components. log "Deploying secrets" chamber exec "fleet-manager" -- make -C "$GITROOT" deploy/secrets @@ -58,14 +52,21 @@ if ! is_openshift_cluster "$CLUSTER_TYPE"; then make -C "$GITROOT" deploy/redhat-pull-secret fi -if [ -z "${DATAPLANE_ONLY}" ] || [ "${DATAPLANE_ONLY}" = "false" ]; then +DATAPLANE_ONLY=${DATAPLANE_ONLY:-} +if [[ "${DATAPLANE_ONLY}" == "" ]]; then + # Deploy database. + log "Deploying database" + make -C "$GITROOT" deploy/db + wait_for_container_to_become_ready "$ACSCS_NAMESPACE" "application=fleet-manager-db" "postgresql" + log "Database is ready." + log "Deploying fleet-manager" make -C "$GITROOT" deploy/service wait_for_container_to_appear "$ACSCS_NAMESPACE" "app=fleet-manager" "service" -fi -if [[ "$SPAWN_LOGGER" == "true" && -n "${LOG_DIR:-}" ]]; then + if [[ "$SPAWN_LOGGER" == "true" && -n "${LOG_DIR:-}" ]]; then $KUBECTL -n "$ACSCS_NAMESPACE" logs -l app=fleet-manager --all-containers --pod-running-timeout=1m --since=1m --tail=100 -f >"${LOG_DIR}/pod-logs_fleet-manager.txt" 2>&1 & + fi fi log "Deploying fleetshard-sync" @@ -92,25 +93,28 @@ fi # Sanity check. wait_for_container_to_become_ready "$ACSCS_NAMESPACE" "app=fleetshard-sync" "fleetshard-sync" 500 -# Prerequisite for port-forwarding are pods in ready state. -wait_for_container_to_become_ready "$ACSCS_NAMESPACE" "app=fleet-manager" "service" -if [[ "$ENABLE_EMAIL_SENDER" == "true" ]]; then - wait_for_container_to_become_ready "$ACSCS_NAMESPACE" "application=emailsender" "emailsender" -fi +if [[ "${DATAPLANE_ONLY}" == "" ]]; then + # Prerequisite for port-forwarding are pods in ready state. + wait_for_container_to_become_ready "$ACSCS_NAMESPACE" "app=fleet-manager" "service" -if [[ "$ENABLE_FM_PORT_FORWARDING" == "true" ]]; then - log "Starting port-forwarding for fleet-manager" - port-forwarding start fleet-manager 8000 8000 -else - log "Skipping port-forwarding for fleet-manager" + if [[ "$ENABLE_FM_PORT_FORWARDING" == "true" ]]; then + log "Starting port-forwarding for fleet-manager" + port-forwarding start fleet-manager 8000 8000 + else + log "Skipping port-forwarding for fleet-manager" + fi + + if [[ "$ENABLE_DB_PORT_FORWARDING" == "true" ]]; then + log "Starting port-forwarding for db" + port-forwarding start fleet-manager-db 5432 5432 + else + log "Skipping port-forwarding for db" + fi fi -if [[ "$ENABLE_DB_PORT_FORWARDING" == "true" ]]; then - log "Starting port-forwarding for db" - port-forwarding start fleet-manager-db 5432 5432 -else - log "Skipping port-forwarding for db" +if [[ "$ENABLE_EMAIL_SENDER" == "true" ]]; then + wait_for_container_to_become_ready "$ACSCS_NAMESPACE" "application=emailsender" "emailsender" fi log diff --git a/scripts/ci/multicluster_tests/run_multicluster_tests.sh b/scripts/ci/multicluster_tests/run_multicluster_tests.sh old mode 100644 new mode 100755 index 84521cad6..66aa2ec19 --- a/scripts/ci/multicluster_tests/run_multicluster_tests.sh +++ b/scripts/ci/multicluster_tests/run_multicluster_tests.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash - +set -e # This script assumes that there were two clusters created before execution. # It expects that those clusters are accessible through kubeconfig files at the path # value stored in following environment variables: @@ -25,7 +25,7 @@ make deploy/dev # signed certificate before starting fleet-manager. We don't want that which is why we're seeting # termination to edge for this route kubectl patch -n rhacs route fleet-manager -p '{"spec":{"tls":{"termination":"edge"}}}' -FM_URL="https://$(k get routes -n rhacs fleet-manager -o yaml | yq .spec.host)" +FM_URL="https://$(kubectl get routes -n rhacs fleet-manager -o yaml | yq .spec.host)" export FM_URL kubectl get cm -n rhacs fleet-manager-dataplane-cluster-scaling-config -o yaml > fm-dataplane-config.yaml