forked from inflection-zone/rean-admin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.sh
47 lines (44 loc) · 1.94 KB
/
entrypoint.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
#!/bin/bash
# ENVIRONMENT=$1
# # Determine the environment and set S3 paths accordingly
# case "$ENVIRONMENT" in
# "dev")
# ENV_FILE_BUCKET="duploservices-dev-configs-new-167414264568/rean-admin-portal"
# CONSTANTS_FILE_BUCKET="duploservices-dev-configs-new-167414264568/rean-admin-portal"
# FAVICON_FILE_BUCKET="duploservices-dev-configs-new-167414264568/rean-admin-portal"
# ;;
# "uat")
# ENV_FILE_BUCKET="duploservices-uat-configs-new-167414264568/rean-admin-portal"
# CONSTANTS_FILE_BUCKET="duploservices-uat-configs-new-167414264568/rean-admin-portal"
# FAVICON_FILE_BUCKET="duploservices-uat-configs-new-167414264568/rean-admin-portal"
# ;;
# "prod")
# ENV_FILE_BUCKET="duploservices-prod-configs-new-167414264568/rean-admin-portal"
# CONSTANTS_FILE_BUCKET="duploservices-prod-configs-new-167414264568/rean-admin-portal"
# FAVICON_FILE_BUCKET="duploservices-prod-configs-new-167414264568/rean-admin-portal"
# ;;
# "aha-prod")
# ENV_FILE_BUCKET="duploservices-ahaprod-configs-167414264568/rean-admin-portal"
# CONSTANTS_FILE_BUCKET="duploservices-ahaprod-configs-167414264568/rean-admin-portal"
# FAVICON_FILE_BUCKET="duploservices-ahaprod-configs-167414264568/rean-admin-portal"
# ;;
# "aha-uat")
# ENV_FILE_BUCKET="duploservices-uat-configs-new-167414264568/rean-admin-portal-aha"
# CONSTANTS_FILE_BUCKET="duploservices-uat-configs-new-167414264568/rean-admin-portal-aha"
# FAVICON_FILE_BUCKET="duploservices-uat-configs-new-167414264568/rean-admin-portal-aha"
# ;;
# *)
# echo "Unknown environment: $ENVIRONMENT"
# exit 1
# ;;
# esac
# Copy files from S3
aws s3 cp s3://$ENV_FILE_BUCKET/.env ./.env
aws s3 cp s3://$CONSTANTS_FILE_BUCKET/constants.ts ./src/lib/constants.ts
aws s3 cp s3://$FAVICON_FILE_BUCKET/favicon.png ./static/favicon.png
chmod +x ./src/lib/constants.ts
cd /app/build
# Add any other scripts here...
# Start the service
# npm run start
node index.js