Skip to content

Instantly share code, notes, and snippets.

@craigvantonder
Last active February 11, 2021 12:15
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save craigvantonder/c1cdced4764166e9acb5dfd92996f932 to your computer and use it in GitHub Desktop.
Save craigvantonder/c1cdced4764166e9acb5dfd92996f932 to your computer and use it in GitHub Desktop.
How to install AWS Code Deploy agent in Ubuntu 14.04 / 16.04 / 18.04 / 20.04
#!/bin/bash
# AWS CLI
apt-get install zip -y;
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip";
unzip awscli-bundle.zip;
./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws;
aws configure;
#AWS Access Key ID [None]: Obtained when creating user in AWS IAM
#AWS Secret Access Key [None]: Obtained when creating user in AWS IAM
#Default region name [None]: Your region, e.g. eu-central-1
#Default output format [None]:
#########
# 14.04 # http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-run-agent-install.html
#########
# Python dependency
sudo apt-get update;
sudo apt-get install python-pip;
# Ruby dependency
sudo apt-get install ruby2.0;
# CodeDeploy Agent
cd /home/ubuntu;
wget https://aws-codedeploy-eu-central-1.s3.amazonaws.com/latest/install;
chmod +x ./install;
sudo ./install auto;
sudo service codedeploy-agent start
sudo service codedeploy-agent status
#########
# 16.04 # https://github.com/aws/aws-codedeploy-agent/issues/61
#########
# Python dependency
sudo apt-get update;
sudo apt-get install python-pip;
# Ruby dependency
sudo mkdir -p /etc/apt/sources.list.d
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C3173AA6
cat <<EOF | sudo tee /etc/apt/sources.list.d/brightbox-ubuntu-ruby-ng-wily.list
deb http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu wily main
EOF
sudo apt-get update
sudo apt-get install ruby2.0
# CodeDeploy Agent
cd /home/ubuntu;
wget https://aws-codedeploy-eu-central-1.s3.amazonaws.com/latest/install;
chmod +x ./install;
sudo ./install auto;
sudo systemctl start codedeploy-agent
sudo systemctl status codedeploy-agent
#########
# 18.04 / 20.04 # https://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent-operations-install-ubuntu.html
#########
# Switch to root and update first
sudo su;
apt update;
# Ruby dependency
apt install -y ruby;
# CodeDeploy Agent
cd /home/ubuntu;
wget https://aws-codedeploy-eu-central-1.s3.amazonaws.com/latest/install;
chmod +x ./install;
./install auto;
# Enable and check status of the agent
systemctl start codedeploy-agent;
systemctl status codedeploy-agent;
@RudyJessop
Copy link

Beautiful....Thanks alot bro

@waltersud
Copy link

Excelente !!

@fleet-app
Copy link

amazing and great.. thanks you so much

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