Menu
AWS CodeDeploy
User Guide (API Version 2014-10-06)

AppSpec File Example

Here is an example of an AppSpec file for an in-place deployment to an Amazon Linux, Ubuntu Server, or RHEL instance.

Copy
version: 0.0 os: linux files: - source: Config/config.txt destination: /webapps/Config - source: source destination: /webapps/myApp hooks: BeforeInstall: - location: Scripts/UnzipResourceBundle.sh - location: Scripts/UnzipDataBundle.sh AfterInstall: - location: Scripts/RunResourceTests.sh timeout: 180 ApplicationStart: - location: Scripts/RunFunctionalTests.sh timeout: 3600 ValidateService: - location: Scripts/MonitorService.sh timeout: 3600 runas: codedeployuser

For a Windows Server instance, change os: linux to os: windows. Also, you must fully qualify the destination paths (for example, c:\temp\webapps\Config and c:\temp\webapps\myApp). Do not include the runas element.

Here is the sequence of events during deployment:

  1. Run the script located at Scripts/UnzipResourceBundle.sh.

  2. If the previous script returned an exit code of 0 (success), run the script located at Scripts/UnzipDataBundle.sh.

  3. Copy the file from the path of Config/config.txt to the path /webapps/Config/config.txt.

  4. Recursively copy all the files in the source directory to the /webapps/myApp directory.

  5. Run the script located at Scripts/RunResourceTests.sh with a timeout of 180 seconds (3 minutes).

  6. Run the script located at Scripts/RunFunctionalTests.sh with a timeout of 3600 seconds (1 hour).

  7. Run the script located at Scripts/MonitorService.sh as the user codedeploy with a timeout of 3600 seconds (1 hour).