Forked from lifeeth/aws_codedeploy_agent_install.sh
Created
January 20, 2022 01:02
-
-
Save hakube/a42cb8a7c186c80cb2a9482d4c2ab559 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
This file contains hidden or 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 | |
| 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment