Skip to content

Instantly share code, notes, and snippets.

@lifeeth
Last active January 20, 2022 01:02
Show Gist options
  • Save lifeeth/557722cd62eb41010807ad1a2ce6ba41 to your computer and use it in GitHub Desktop.
Save lifeeth/557722cd62eb41010807ad1a2ce6ba41 to your computer and use it in GitHub Desktop.
AWS Codedeploy Agent install on Ubuntu 20.04 - Until a package is released for Ubuntu 20.04
#!/usr/bin/env bash
sudo snap install ruby --channel=2.5/stable --classic
sudo gem install bundler
sudo 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
pushd /opt/codedeploy-agent
sudo bundle install --system
sudo /snap/bin/rake clean && sudo /snap/bin/rake
sudo cp /opt/codedeploy-agent/init.d/codedeploy-agent.service /etc/systemd/system
# Run codedeploy as root - Be aware of the security implications
sudo sed -i 's/\(User=\)\(.*\)/\1root/' /etc/systemd/system/codedeploy-agent.service
sudo sed -i 's/#User/User/g' /etc/systemd/system/codedeploy-agent.service
sudo systemctl daemon-reload
sudo systemctl enable codedeploy-agent
popd
@cmllamosas
Copy link

@lifeeth That is weird i try many times with your snippet, can you share ur public ami-id, to try with that again.

@lifeeth
Copy link
Author

lifeeth commented May 4, 2020

@cmllamosas - I have been using the same AMI. Could you share your codedeploy-agent.service? I do run an apt-get upgrade before installing though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment