Skip to content

Instantly share code, notes, and snippets.

@rjocoleman
Created April 24, 2014 20:33
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 rjocoleman/11268563 to your computer and use it in GitHub Desktop.
Save rjocoleman/11268563 to your computer and use it in GitHub Desktop.
Capistrano Slug basic config. Assumes that the AMI being launched includes webserver and directory set up already. With this config after Capistrano deploys it will take an archive of the current application directory. Use `user_data.sh` when starting your EC2 instance and it'll download the latest slug and extract it - assuming the rest of the …
set :application, 'foo-application'
set :deploy_to, '/var/www/foo-application'
set :slug_s3_bucket, 'capistrano-slug-bucket'
after 'deploy:finished', 'slug'
#!/bin/bash
aws s3 cp s3://capistrano-slug-bucket/foo-application-slug.tar.gz /tmp/foo-application-slug.tar.gz
tar zxf /tmp/foo-application-slug.tar.gz -C /var/www/foo-application
rm /tmp/foo-application-slug.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment