forked from cleanappio/cleanapp_back_end_v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_and_deploy.sh
More file actions
executable file
·46 lines (42 loc) · 1.22 KB
/
build_and_deploy.sh
File metadata and controls
executable file
·46 lines (42 loc) · 1.22 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
OPT=""
SSH_KEYFILE=""
while [[ $# -gt 0 ]]; do
case $1 in
"-e"|"--env")
OPT="$2"
shift 2
;;
"--ssh-keyfile")
SSH_KEYFILE="$2"
shift 2
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
if [ -z "${OPT}" ]; then
echo "Usage: $0 -e|--env <dev|prod> [--ssh-keyfile <ssh_keyfile>]"
exit 1
fi
if [ -z "${SSH_KEYFILE}" ]; then
echo "Usage: $0 -e|--env <dev|prod> [--ssh-keyfile <ssh_keyfile>]"
exit 1
fi
for project_dir in areas-service auth-service brand-dashboard custom-area-dashboard customer-service report-analyze-pipeline report-listener report-processor email-service report-ownership-service gdpr-process-service face-detector reports-pusher report-listener-v4 report-fast-renderer; do
pushd $project_dir
if [ -f "build_image.sh" ]; then
echo "Building image for ${project_dir}..."
./build_image.sh -e ${OPT}
elif [ -f "build_images.sh" ]; then
echo "Building images for ${project_dir}..."
./build_images.sh -e ${OPT}
else
echo "No build_image.sh or build_images.sh found for ${project_dir}, skipping..."
fi
popd
done
pushd setup
./setup_from_local.sh -e ${OPT} --ssh-keyfile ${SSH_KEYFILE}
popd