-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdeploy_bronze.sh
More file actions
executable file
·60 lines (46 loc) · 1.73 KB
/
deploy_bronze.sh
File metadata and controls
executable file
·60 lines (46 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Bronze Sample Bundle Deployment
# Sample-specific constants
BUNDLE_NAME="Bronze Sample Bundle"
SCHEMA="${DEFAULT_SCHEMA_NAMESPACE}_bronze"
# Source common library and configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/common.sh"
# Parse command-line arguments
parse_common_args "$@"
# Prompt for missing parameters
prompt_common_params
# Validate all required parameters
if ! validate_required_params; then
exit 1
fi
# Set schema - use command line if provided, otherwise use constant with logical environment
if [[ -n "$schema_namespace" ]]; then
# Use schema from command line
schema="${schema_namespace}_bronze$logical_env"
else
# Use schema constant with logical environment
schema="$SCHEMA$logical_env"
fi
# Set up bundle environment
setup_bundle_env "$BUNDLE_NAME" "$schema"
# Update substitutions file with catalog and schema namespace
if ! update_substitutions_file "bronze_sample/src/pipeline_configs/dev_substitutions.json"; then
log_error "Failed to update substitutions file. Exiting."
exit 1
fi
# Update pipeline global config file with table migration state volume path
if ! update_pipeline_global_config_file "bronze_sample/src/pipeline_configs/global.json"; then
log_error "Failed to update pipeline global config file. Exiting."
exit 1
fi
# Change to bronze_sample directory for deployment
cd bronze_sample
# Deploy the bundle
deploy_bundle "$BUNDLE_NAME"
# Return to parent directory
cd ..
# Restore original substitutions file
restore_substitutions_file "bronze_sample/src/pipeline_configs/dev_substitutions.json"
# Restore original pipeline global config file
restore_pipeline_global_config_file "bronze_sample/src/pipeline_configs/global.json"