1919#
2020# --------------------------------------------------------------------
2121#
22- # Script: destroy-cloudberry -demo-cluster.sh
23- # Description: Destroys and cleans up a demo Apache Cloudberry
22+ # Script: destroy-gpdb -demo-cluster.sh
23+ # Description: Destroys and cleans up a demo Greenplum
2424# cluster.
2525# Performs the following steps:
2626# 1. Sources required environment variables
3535# LOG_DIR - Directory for logs (defaults to ${SRC_DIR}/build-logs)
3636#
3737# Prerequisites:
38- # - Apache Cloudberry environment must be available
38+ # - Greenplum environment must be available
3939# - User must have permissions to remove cluster directories
4040# - No active connections to the cluster
4141#
4242# Usage:
4343# Export required variables:
44- # export SRC_DIR=/path/to/cloudberry /source
44+ # export SRC_DIR=/path/to/gpdb /source
4545# Then run:
46- # ./destroy-cloudberry -demo-cluster.sh
46+ # ./destroy-gpdb -demo-cluster.sh
4747#
4848# Exit Codes:
4949# 0 - Cluster destroyed successfully
5050# 1 - Environment setup/sourcing failed
5151# 2 - Cluster destruction failed
5252#
5353# Related Scripts:
54- # - create-cloudberry -demo-cluster.sh: Creates a new demo cluster
54+ # - create-gpdb -demo-cluster.sh: Creates a new demo cluster
5555#
5656# Notes:
5757# - This script will forcefully terminate all cluster processes
@@ -64,38 +64,38 @@ set -euo pipefail
6464
6565# Source common utilities
6666SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
67- source " ${SCRIPT_DIR} /cloudberry -utils.sh"
67+ source " ${SCRIPT_DIR} /gpdb -utils.sh"
6868
6969# Define log directory
7070export LOG_DIR=" ${SRC_DIR} /build-logs"
7171CLUSTER_LOG=" ${LOG_DIR} /destroy-cluster.log"
7272
7373# Initialize environment
74- init_environment " Destroy Cloudberry Demo Cluster Script" " ${CLUSTER_LOG} "
74+ init_environment " Destroy Greenplum Demo Cluster Script" " ${CLUSTER_LOG} " " /opt/greenplum-db-6 "
7575
76- # Source Cloudberry environment
76+ # Source Greenplum environment
7777log_section " Environment Setup"
78- source_cloudberry_env || {
79- echo " Failed to source Cloudberry environment" | tee -a " ${CLUSTER_LOG} "
78+ source_greenplum_env || {
79+ echo " Failed to source Greenplum environment" | tee -a " ${CLUSTER_LOG} "
8080 exit 1
8181}
8282log_section_end " Environment Setup"
8383
8484# Destroy demo cluster
8585log_section " Destroy Demo Cluster"
86- execute_cmd make destroy-demo-cluster --directory ${SRC_DIR} /../cloudberry || {
86+ execute_cmd make destroy-demo-cluster --directory ${SRC_DIR} /../gpdb || {
8787 echo " Failed to destroy demo cluster" | tee -a " ${CLUSTER_LOG} "
8888 exit 2
8989}
9090log_section_end " Destroy Demo Cluster"
9191
9292# Verify cleanup
9393log_section " Cleanup Verification"
94- if [ -d " ${SRC_DIR} /../cloudberry /gpAux/gpdemo/data" ]; then
94+ if [ -d " ${SRC_DIR} /../gpdb /gpAux/gpdemo/data" ]; then
9595 echo " Warning: Data directory still exists after cleanup" | tee -a " ${CLUSTER_LOG} "
9696fi
9797log_section_end " Cleanup Verification"
9898
9999# Log completion
100- log_completion " Destroy Cloudberry Demo Cluster Script" " ${CLUSTER_LOG} "
100+ log_completion " Destroy Greenplum Demo Cluster Script" " ${CLUSTER_LOG} "
101101exit 0
0 commit comments