jkovba
jkovba

Reputation: 1269

Writing an appspec.yml File for Deployment from GitHub to AWS CodeDeploy

I'd like to make it so that a commit to our GitHub repo automatically deploys code (using CodeDeploy) to our EC2 instances. I'm not clear what to use for the 'source' entry under the 'files' section in the appspec.yml file. I've found some examples for using a local git repo, but I was wondering if someone could help me out?

Thanks in advance for your help!

Upvotes: 2

Views: 9211

Answers (3)

Jonathan Turpie
Jonathan Turpie

Reputation: 1363

The appspec.yml roots all paths for source files (and scripts) to the archive bundle's root. The destination paths are rooted in the system root.

This appspec.yml would copy all files from the foo directory of your archive bundle recursively to /www/foo-app/ on your system.

files:
  - source: /foo
    destination: /www/foo-app/

See http://docs.aws.amazon.com/codedeploy/latest/userguide/app-spec-ref.html or http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-add-appspec-file.html for a more detailed reference on the appspec.yml file.

Upvotes: 3

snannapa
snannapa

Reputation: 19

Have you considered using CodePipeline? It does exactly what you are looking for.

You can specify the github source in Code pipeline, and when there is a commit, it can deploy to your "code deploy" fleet. Of course you can do much more with pipeline.

http://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html

Hope this helps.

Upvotes: 1

Related Questions