Created
October 21, 2018 08:35
-
-
Save say8425/8344d19911dba20fab5538b85006bd31 to your computer and use it in GitHub Desktop.
Install codedeploy agent in EC2 user data
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 | |
apt update | |
apt install ruby -y | |
gem install bundler | |
git clone https://github.com/aws/aws-codedeploy-agent.git /opt/codedeploy-agent | |
sudo chown -R root.root /opt/codedeploy-agent | |
sudo chmod 644 /opt/codedeploy-agent/conf/codedeployagent.yml | |
sudo chmod 755 /opt/codedeploy-agent/init.d/codedeploy-agent | |
sudo chmod 644 /opt/codedeploy-agent/init.d/codedeploy-agent.service | |
cd opt/codedeploy-agent | |
bundle install --system | |
rake clean && rake | |
cp /opt/codedeploy-agent/init.d/codedeploy-agent /etc/init.d/ | |
systemctl daemon-reload | |
systemctl start codedeploy-agent | |
systemctl enable codedeploy-agent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment