Skip to content

Instantly share code, notes, and snippets.

@say8425
Created October 21, 2018 08:35
Show Gist options
  • Save say8425/8344d19911dba20fab5538b85006bd31 to your computer and use it in GitHub Desktop.
Save say8425/8344d19911dba20fab5538b85006bd31 to your computer and use it in GitHub Desktop.
Install codedeploy agent in EC2 user data
#!/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