Last active
January 17, 2018 17:22
-
-
Save moshest/32b19e146bc5e1665708c885e535a631 to your computer and use it in GitHub Desktop.
AWS CodeDeploy with Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage: `curl --silent --location https://gist.githubusercontent.com/moshest/32b19e146bc5e1665708c885e535a631/raw/install.sh | bash -` | |
set -e | |
yum -y update | |
AWS_REGION=`curl http://169.254.169.254/latest/dynamic/instance-identity/document|grep region|awk -F\" '{print $4}'` | |
echo AWS Region: $AWS_REGION | |
# install CodeDeploy | |
cd /home/ec2-user | |
yum install -y ruby aws-cli | |
aws s3 cp s3://aws-codedeploy-$AWS_REGION/latest/install . --region $AWS_REGION | |
chmod +x ./install | |
./install auto | |
rm -f install | |
# install node | |
curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - | |
yum -y install make gcc gcc-c++ nodejs default-jre ImageMagick | |
# install latest stable node version with "n" | |
npm install -g n | |
n stable | |
# install pm2 | |
npm install -g pm2 | |
pm2 update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment