Skip to content

Instantly share code, notes, and snippets.

@nhoffmann
Created April 3, 2012 14:07
Show Gist options
  • Select an option

  • Save nhoffmann/2292275 to your computer and use it in GitHub Desktop.

Select an option

Save nhoffmann/2292275 to your computer and use it in GitHub Desktop.

Revisions

  1. nhoffmann revised this gist Apr 7, 2012. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions deploy.rb
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,15 @@
    set :application, "My Static Content"
    set :servername, 'test.example.com'

    # we want to copy files from local directory
    set :repository, "."
    # no git? simply deploy a directory
    set :scm, :none
    set :repository, "." # the directory to deploy

    # using git? deploy from local git repository
    # set :scm, :git
    # set :repository, 'file//.' # path to local git repository

    # files will get copied over
    set :deploy_via, :copy

    # do not copy these files, adjust to your needs
  2. nhoffmann revised this gist Apr 3, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion deploy.rb
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@
    set :scm, :none
    set :deploy_via, :copy

    # do not copy this files, adjust to your needs
    # do not copy these files, adjust to your needs
    set :copy_exclude, [".git", ".gitignore", "Capfile", ".config"]

    # the remote user
  3. nhoffmann created this gist Apr 3, 2012.
    44 changes: 44 additions & 0 deletions deploy.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    set :application, "My Static Content"
    set :servername, 'test.example.com'

    # we want to copy files from local directory
    set :repository, "."
    set :scm, :none
    set :deploy_via, :copy

    # do not copy this files, adjust to your needs
    set :copy_exclude, [".git", ".gitignore", "Capfile", ".config"]

    # the remote user
    set :user, 'username'

    set :use_sudo, false

    # directory where our release and current directories will live
    set :deploy_to, '/var/www/static/my-site'

    role :web, servername
    role :app, servername
    role :db, servername, :primary => true

    # Override default tasks which are not relevant to a non-rails app.
    namespace :deploy do
    task :migrate do
    puts "Skipping migrate."
    end
    task :finalize_update do
    puts "Skipping finalize_update."
    end
    task :start do
    puts "Skipping start."
    end
    task :stop do
    puts "Skipping stop."
    end
    task :restart do
    puts "Skipping restart."
    end
    end

    # leave only 5 releases
    after "deploy", "deploy:cleanup"