forked from awslabs/amazon-redshift-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·67 lines (51 loc) · 2.1 KB
/
build.sh
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
61
62
63
64
65
66
67
#!/bin/bash
# set -x
version=1.4
ARCHIVE=dist/lambda-redshift-util-runner-$version.zip
if [ -f $ARCHIVE ]; then
rm $ARCHIVE
fi
if [ ! -d dist ]; then
mkdir dist
fi
if [ ! -d lib ]; then
mkdir lib
fi
cp -r $PYTHON_PATH/pg8000 lib
cp -r $PYTHON_PATH/shortuuid lib
cp -r $PYTHON_PATH/boto3 lib
cp -r $PYTHON_PATH/pgpasslib* lib
# import the column encoding utility
if [ ! -d lib/ColumnEncodingUtility ]; then
mkdir lib/ColumnEncodingUtility
fi
cp ../ColumnEncodingUtility/analyze-schema-compression.py lib/ColumnEncodingUtility/analyze_schema_compression.py
echo "Imported Column Encoding Utility"
# import the Analyze/Vacuum utility
if [ ! -d lib/AnalyzeVacuumUtility ]; then
mkdir lib/AnalyzeVacuumUtility
fi
cp ../AnalyzeVacuumUtility/lib/analyze_vacuum.py lib/AnalyzeVacuumUtility/analyze_vacuum.py
echo "Imported Analyze/Vacuum Utility"
# import the SystemTablePersistence utility
if [ ! -d lib/SystemTablePersistence ]; then
mkdir lib/SystemTablePersistence
fi
cp ../SystemTablePersistence/snapshot_system_stats.py lib/SystemTablePersistence/snapshot_system_stats.py
cp -R ../SystemTablePersistence/lib lib/SystemTablePersistence
echo "Imported System Table Persistence Utility"
if [ ! -d lib/WorkloadManagementScheduler ]; then
mkdir lib/WorkloadManagementScheduler
fi
cp ../WorkloadManagementScheduler/wlm_scheduler.py lib/WorkloadManagementScheduler/wlm_scheduler.py
cp -R ../WorkloadManagementScheduler/lib lib/WorkloadManagementScheduler
echo "Imported Workload Management"
if [ ! -d lib/amazon-redshift-monitoring ]; then
cd lib && git clone https://github.com/awslabs/amazon-redshift-monitoring
else
cd lib/amazon-redshift-monitoring && git pull
fi
echo "Imported Redshift Advance Monitoring"
cd -
# build the combined lambda package
zip -r $ARCHIVE *.py config.json .pgpass ../aws_utils.py ../config_constants.py lib/AnalyzeVacuumUtility lib/ColumnEncodingUtility lib/WorkloadManagementScheduler lib/SystemTablePersistence lib/pg8000* lib/shortuuid* lib/pgpasslib* lib/amazon-redshift-monitoring/redshift_monitoring.py lib/amazon-redshift-monitoring/sql/ lib/amazon-redshift-monitoring/monitoring-queries.json