-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtasks_github_actions.sh
More file actions
49 lines (38 loc) · 973 Bytes
/
tasks_github_actions.sh
File metadata and controls
49 lines (38 loc) · 973 Bytes
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
#!/bin/bash
set -Eeo pipefail
task="$1"
function build_lambda {
lambda_name=$1
build_dir=lambdas/build/$lambda_name
utils_dir=lambdas/$lambda_name/utils
rm -rf $build_dir
mkdir -p $build_dir
requirements_file=lambdas/requirements/requirements.txt
if test -f "$requirements_file"; then
pip install -r $requirements_file -t $build_dir
fi
cp lambdas/$lambda_name/*.py $build_dir
if [ -d "$utils_dir" ]; then
mkdir -p "$build_dir/utils"
cp "$utils_dir"/*.py "$build_dir/utils/"
fi
pushd $build_dir
zip -r -X ../$lambda_name.zip .
popd
}
echo "--- ${task} ---"
case "${task}" in
build-lambdas)
build_lambda log_alerts_technical_failures_above_threshold
build_lambda log_alerts_pipeline_error
build_lambda email_report
build_lambda validate_metrics
build_lambda gp2gp_dashboard_alert
build_lambda store_asid_lookup
;;
*)
echo "Invalid task: '${task}'"
exit 1
;;
esac
set +e