Last active
November 2, 2019 07:14
-
-
Save cjlyth/fd0d6b986b96e0ee5b64ebaea9387a03 to your computer and use it in GitHub Desktop.
dev-instance-userdata.sh
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
#!/usr/bin/env bash | |
yum update -y | |
yum groupinstall "Development Tools" -y | |
sudo -u ec2-user git config --global credential.helper '!aws codecommit credential-helper $@' | |
sudo -u ec2-user git config --global credential.UseHttpPath true | |
# Borrowed from https://forums.aws.amazon.com/thread.jspa?messageID=911050 | |
echo "Setting up NodeJS Environment" | |
curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash | |
echo 'export NVM_DIR="/home/ec2-user/.nvm"' >> /home/ec2-user/.bashrc | |
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> /home/ec2-user/.bashrc | |
# Dot source the files to ensure that variables are available within the current shell | |
. /home/ec2-user/.nvm/nvm.sh | |
. /home/ec2-user/.bashrc | |
# Install NVM, NPM, Node.JS & Grunt | |
nvm alias default v12.13.0 | |
nvm install v12.13.0 | |
nvm use v12.13.0 | |
curl -o- -L https://yarnpkg.com/install.sh | bash | |
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment