Documentation

EC2-AutoScaling-CodePipeline TutorialVideo walkthrough

Step 1.

Create a hosted zone for your domain in Route53.

Step 2.

Request a HTTPS certificate from AWS CertificateManager for your domain.

Step 3.

Move your app files to a parent folder called src in your project root. Add an appspec.yaml file to your project root and a start_server.sh script to a folder named scripts in your project root. The commands in the start_server.sh script will differ based on your app. Check here for an example.

appspec.yaml
version: 0.0
os: linux
files:
  - source: /src
    destination: /home/ec2-user/
hooks:
  ApplicationStart:
    - location: /scripts/start_server.sh
      timeout: 300
      runas: root
scripts/start_server.sh
#!/bin/bash -x
curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash -
sudo yum install -y gcc-c++ make git docker nodejs
sudo service docker start
cd /home/ec2-user
sudo docker stop mongo
sudo docker rm mongo
sudo docker stop app
sudo docker rm app
sudo rm tape.txt
sudo node index &>/dev/null &
sudo node server &>/dev/null &

Step 4.

Create a GitHub auth token with webhook & read access for your repo.

Step 5.

Deploy this CloudFormation template using the hosted zone Id from step 1, the ARN of the certificate obtained in step 2, and the GitHub token from step 4.

Step 6.

Using the outputs from the CloudFormation build, test your app with the Source Reports checker here.

Step 7.

Once the checker passes, approve the prompt requesting permission for Source Reports to check your source code every few minutes.