-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathconfig.sh
More file actions
executable file
·30 lines (30 loc) · 857 Bytes
/
config.sh
File metadata and controls
executable file
·30 lines (30 loc) · 857 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
#!/bin/bash
echo CONFIGURING THE ENVIRONMENT
echo #############################
echo Updating the attached instance
sudo yum update -y
echo --
echo Updating node to the latest version
node_version=$(nvm ls-remote --lts | grep Latest | tail -1 | grep -o 'v[.0-9]*' | sed 's/\x1b\[[0-9;]*m//g')
node_version=${node_version:1}
nvm install --lts
nvm alias latest $node_version
nvm alias default latest
nvm use $node_version
echo --
echo Installing Typescript
npm install -g typescript
echo --
echo Installing CDK
npm install -g aws-cdk
echo --
echo Bootstraping CDK
account=$(aws sts get-caller-identity --output text --query 'Account')
region=$(aws configure get region)
cdk bootstrap $account/$region
echo --
echo Installing dependencies
cd cdk
npm install
[[ $(grep "nvm use latest" ~/.bash_profile) ]] || echo nvm use latest >> ~/.bash_profile
echo ### DONE