I'm working through the AWS blog post on how to deploy code directly from BitBucket using AWS CodeDeploy. Most of it's fairly straightforward until I get to the point where it mentions an appspec.yml file. I understand that the purpose is to describe what to deploy and how to do it, but I'm not understanding how to do that for an application, rather than just a simple page. In my previous experience there would be a series of steps such as
I assume that there's some correlation between the steps I've written above and the "files" and "hooks" sections in the appspec.yml file detailed here. Unfortunately I can't figure out a mapping in my head between the two, and every blog post, online doc, and video I've found pretty much just says "you need this file" and points to an example that moves one static file and has one or two hooks. I'm at a loss as to how to integrate the actual build portions of the deployment.
Can anyone either provide an example appspec.yml file which accounts for a full application deployment, rather than a simple copy paste, or point me towards a resource which better explains this process?
CodeDeploy is for deploying a built application. Builds and anything beforehand need to be managed separately. Your zip file you pass to codedeploy should be the built application plus an appspec describing installation.
Below is an appspec for a .NET application of mine.
version: 0.0
os: windows
files:
- source: /
destination: C:\inetpub\wwwroot
hooks:
BeforeInstall:
- location: CodeDeploy/appstop.bat
runas: administrator
ApplicationStart:
- location: CodeDeploy/appstart.bat
runas: administrator
With regards to codedeploy, my process is this: