Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makeittotop/1394226fec1c9c27fb72f728e92a6870 to your computer and use it in GitHub Desktop.
Save makeittotop/1394226fec1c9c27fb72f728e92a6870 to your computer and use it in GitHub Desktop.
AWS CodeDeploy Sample appspec.yml
version: 0.0
os: linux
files:
- source: /index.html
destination: /var/www/html/
hooks:
BeforeInstall:
- location: scripts/install_dependencies
timeout: 300
runas: root
- location: scripts/start_server
timeout: 300
runas: root
ApplicationStop:
- location: scripts/stop_server
timeout: 300
runas: root
[]$ cat scripts/install_dependencies
#!/bin/bash
yum install -y httpd
[]$ cat scripts/start_server
#!/bin/bash
service httpd start
[apareek@foo my_sample_app]$ cat scripts/stop_server
#!/bin/bash
isExistApp = `pgrep httpd`
if [[ -n $isExistApp ]]; then
service httpd stop
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment