Skip to content

Instantly share code, notes, and snippets.

@Sanyambansal76
Last active January 12, 2017 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sanyambansal76/9add20e6cde8eedff301044e656df1dc to your computer and use it in GitHub Desktop.
Save Sanyambansal76/9add20e6cde8eedff301044e656df1dc to your computer and use it in GitHub Desktop.
AWS CodeDeploy and Codeship Intergration
#Create a aws account
#CREATE I AM ROLE
1. Create the IAM role
2. Open the IAM from the your aws dashboard
3. Click on the roles
4. Click on create new role
5. Enter the Role Name CodeDeployInstanceRole
6. Attach Following Policies
a. AmazonEC2RoleforAWSCodeDeploy
b. AutoScalingNotificationAccessRole
c. AmazonS3ReadOnlyAccess
7. Click on create new role
a. Enter the Role Name CodeDeployServiceRole
b. Attach Following Policies
A. AmazonS3ReadOnlyAccess
B. AWSCodeDeployRole
c. Click on Trust Relationship
d. Ensure the the identity provider must be codedeploy.amazonaws.com
#CREATE S3 BUCKET
1. Create the S3 Bucket
2. Create a bucket
3. While creating the bucket ensure that your ec2 instance and bucket will be in same origin
4. Learn how to create s3 bucket from Setup Single Instance
#INSTALL CODE-DEPLOY AGENT
1. Install the codedeploy agent on the ec2 instance
2. Read this articial http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-run-agent-install.html
3. Script for the installment in the Oregon region
a. sudo apt-add-repository ppa:brightbox/ruby-ng
b. sudo apt-get update
c. sudo apt-get install ruby2.2
d. sudo apt-get install wget
e. wget https://aws-codedeploy-us-west-2.s3.amazonaws.com/latest/install
d. chmod +x ./install
f. sudo ./install auto
4. Install It from the codebase by running
5. sh scripts/install_codedeploy_agent.sh
#CREATE CODEDEPLOY APPLICATION
1. Open the codedeploy from the AWS dashboard
2. Click on create new application
3. Add the application name and the deployment group name for example Staging, Prod etc
4. Add the instance with the deployment group by using the name or other tags
#ADD A DEPLOYMENT USING CODESHIP
1. Trigger the deployment with the codeship
2. Open the codeship dashboard
3. Click on project settings and select the deployment
4. Add new deployment pipeline
5. Select the AWS codedeployment for the selected branch
6. Add the details for example
a. AWS Access Key ID: ****************CVVA # it is access id of aws cred
b. AWS Secret Access Key: ************************************+Rch
c. Region: us-west-2
d. Application Name: CodeDeploy-APP # YOUR CODEDEPLOY APPLICATION NAME
e. Deployment Group Name: PROD # YOUR DEPLOYMENT GROUP NAME
d. S3 Bucket: codedeploy-bucket #YOUR BUCKET NAME
7. Create a success full build to trigger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment