-
Notifications
You must be signed in to change notification settings - Fork 0
/
start-up_v2.sh
29 lines (24 loc) · 987 Bytes
/
start-up_v2.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
#!/bin/bash -ex
################################################################################
## Version 2 (new Directory Application) user_data script ##
################################################################################
# Install nodejs
yum -y update
curl -sL https://rpm.nodesource.com/setup_16.x | bash -
yum -y install nodejs
# Install Amazon Linux extras and stress tool
amazon-linux-extras install -y epel
yum -y install stress
# Get and install the application
wget https://aws-tc-largeobjects.s3-us-west-2.amazonaws.com/ILT-TF-100-TECESS-5/app/app.zip
mkdir -p /var/app
unzip app.zip -d /var/app
cd /var/app
# Configure the application
REGION=`curl http://169.254.169.254/latest/dynamic/instance-identity/document|grep region|awk -F\" '{print $4}'`
export PHOTOS_BUCKET=employee-photo-bucket-cl #TODO bucked-id.
export DEFAULT_AWS_REGION=${REGION}
export SHOW_ADMIN_TOOLS=1
# Install dependencies and start the app
npm install
npm start