Skip to content

Commit

Permalink
chore: debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Sep 26, 2024
1 parent 116a828 commit d07f6e6
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions legacy/build-deploy-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1619,9 +1619,41 @@ previousStepEnd=${currentStepEnd}
CURRENT_DEPLOYMENTS=$(kubectl -n ${NAMESPACE} get deployments -l "lagoon.sh/service-type" -l "lagoon.sh/service" --no-headers | cut -d " " -f 1 | xargs)
CURRENT_PVCS=$(kubectl -n ${NAMESPACE} get pvc -l "lagoon.sh/service-type" --no-headers | cut -d " " -f 1 | xargs)
CURRENT_SERVICES=$(kubectl -n ${NAMESPACE} get services -l "lagoon.sh/service-type" -l "lagoon.sh/service" --no-headers | cut -d " " -f 1 | xargs)

CURRENT_MARIADB_CONSUMERS=$(kubectl -n ${NAMESPACE} get mariadbconsumers -l "lagoon.sh/service-type" -l "lagoon.sh/service" --no-headers | cut -d " " -f 1 | xargs)
CURRENT_POSTGRES_CONSUMERS=$(kubectl -n ${NAMESPACE} get postgresqlconsumers -l "lagoon.sh/service-type" -l "lagoon.sh/service" --no-headers | cut -d " " -f 1 | xargs)
CURRENT_MONGODB_CONSUMERS=$(kubectl -n ${NAMESPACE} get mongodbconsumers -l "lagoon.sh/service-type" -l "lagoon.sh/service" --no-headers | cut -d " " -f 1 | xargs)

# using the build-deploy-tool identify the deployments, volumes, and services that this build has created
LAGOON_DEPLOYMENTS_TO_JSON=$(build-deploy-tool identify lagoon-services --images /kubectl-build-deploy/images.yaml | jq -r )

echo "${LAGOON_DEPLOYMENTS_TO_JSON}"
for EXIST_CONSUMERS in ${CURRENT_MARIADB_CONSUMERS}; do
echo "mariadb: ${EXIST_CONSUMERS}"
done
for EXIST_CONSUMERS in ${CURRENT_POSTGRES_CONSUMERS}; do
echo "postgres: ${EXIST_CONSUMERS}"
done
for EXIST_CONSUMERS in ${CURRENT_MONGODB_CONSUMERS}; do
echo "mongodb: ${EXIST_CONSUMERS}"
done

for DBAAS_ENTRY in "${DBAAS[@]}"
do
IFS=':' read -ra DBAAS_ENTRY_SPLIT <<< "$DBAAS_ENTRY"
SERVICE_NAME=${DBAAS_ENTRY_SPLIT[0]}
SERVICE_TYPE=${DBAAS_ENTRY_SPLIT[1]}
SERVICE_NAME_UPPERCASE=$(echo "$SERVICE_NAME" | tr '[:lower:]' '[:upper:]' | tr '-' '_')
if [[ "$SERVICE_TYPE}" =~ "-single" ]]; then
# skip to next if this type is a single
continue
fi

if [ $SERVICE_TYPE == "mariadb-dbaas" ] || [ $SERVICE_TYPE == "postgres-dbaas" ] || [ $SERVICE_TYPE == "mongodb-dbaas" ]; then
echo "${SERVICE_NAME}: nothing to monitor for $SERVICE_TYPE"
fi
done

# check the current deployments in the environment against what the build has created and mark anything that isnt in this build as needing removal
MATCHED_DEPLOYMENT=false
DELETE_DEPLOYMENT=()
Expand Down

0 comments on commit d07f6e6

Please sign in to comment.