Skip to content
Demo of AWS code deploy, deploying docker container using Chef and CodeShip Pro
Branch: master
Clone or download
Latest commit b9bd38f Apr 3, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
chef Update Apr 3, 2019
devsetup Update Apr 3, 2019
infra Destroy infra Apr 3, 2019
webapp Update Apr 3, 2019
.gitignore Update Apr 3, 2019
Dockerfile.chef Update Apr 3, 2019
LICENSE Add license Apr 3, 2019 update Apr 3, 2019
aws-deployment.env.encrypted Update Apr 3, 2019
codeship-services.yml Update Apr 3, 2019
codeship-steps.yml Update Apr 3, 2019

Demo project: Codeship Pro + AWS CodeDeploy + Docker + Chef

This is a demo project demonstrating and making use of the following:

  • CodeShip Pro
  • AWS CodeDeploy + Docker
  • Chef
  • Terraform

We will be deploying a demo web application (written in Golang, but that doesn't matter) as a docker container using CodeShip Pro's native integration with AWS CodeDeploy. Instead of writing shell scripts (Bash, Powershell), we will be using chef cookbooks to deploy our application.

The sub-directories in this repo are described next.


The cookbook for deploying the web application is stored here. It also contains a Berksfile specifying the cookbook dependencies. The ./ script "vendors" these dependencies based on the Berksfile, creates a zip file and uploads it to S3.

The solo.rb file contains the configuration for chef-solo.


This directory contains the Terraform configuration for configuring the AWS infrastructure:

  • Configures the Autoscaling group, launch configuration, VPC, subnets and security group
  • Configures the Codedeploy deployment application, deployment group, S3 bucket for storing the build artifacts and required IAM policies
  • Configures the IAM user and creates appropriate IAM policies to deploy the web application from CodeShip pro.
  • data/user_data.txt: This specifies the user data for the EC2 instances launched via the autoscaling group. We use the user data script to install AWS codedeploy agent, chef workstation and other utilities.

The terraform tfstate file is also version controlled for the purposes of this demo, but should be configured to use remote state instead.


This diretory contains the source code for our web application, the Dockerfile for building the docker image and the AWS codedeploy specific files in the deployment/ sub-directory.


This directory contains Terraform configuration for setting up a Linux AWS lightsail instance which may be useful for setting up your project. We use user data script to install docker and jet CLI. Since the terraform configuration will create a AWS Key pair for SSH-ing into your instance, it will output the SSH private key when you apply the terraform configuration. Save it to a local file and use that to SSH into your instance. Hence, the state file is explicitly ignored in .gitignore. By default, the AWS lightsail instance will allow connections on port 22 from any IPs, so, be mindful of this.



You can’t perform that action at this time.