Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 63 lines (50 sloc) 2.023 kB
4baef48 @gma Deploy with vlad.
authored
1 set :application, "nesta"
2 set :repository, "git://github.com/gma/nesta.git"
3
4 # Set :user if you want to connect (via ssh) to your server using a
5 # different username. You will also need to include the user in :domain
6 # (see below).
7 #
8 #set :user, "deploy"
d341195 @gma Fixed domain variable when remote user is specified.
authored
9 #set :domain, "#{user}@example.com"
cb31525 @gma More work on the vlad deployment recipes.
authored
10 set :domain, "example.com"
4baef48 @gma Deploy with vlad.
authored
11
12 set :deploy_to, "/var/apps/#{application}"
1f41b93 @gma Removed the unused thin_socket variable.
authored
13
14 # ============================================================================
374bdc6 @gma Added the deploy rake task, for updating and restarting the app server.
authored
15 # You probably don't need to worry about anything beneath this point...
1f41b93 @gma Removed the unused thin_socket variable.
authored
16 # ============================================================================
cb31525 @gma More work on the vlad deployment recipes.
authored
17
18 require "tempfile"
19 require "vlad"
20
21 namespace :vlad do
bf8f94f @gma Push config.yml during setup, symlink it into current on update.
authored
22 remote_task :config_yml do
23 put "#{shared_path}/config.yml", "vlad.config.yml" do
cb31525 @gma More work on the vlad deployment recipes.
authored
24 File.open(File.join(File.dirname(__FILE__), "config.yml")).read
25 end
26 end
bf8f94f @gma Push config.yml during setup, symlink it into current on update.
authored
27
28 task :setup do
374bdc6 @gma Added the deploy rake task, for updating and restarting the app server.
authored
29 Rake::Task["vlad:config_yml"].invoke
bf8f94f @gma Push config.yml during setup, symlink it into current on update.
authored
30 end
31
32 remote_task :symlink_config_yml do
33 run "ln -s #{shared_path}/config.yml #{current_path}/config/config.yml"
34 end
35
4256a59 @gma Create public/attachments so nginx can serve attachments.
authored
36 remote_task :symlink_attachments do
37 run "ln -s #{shared_path}/content/attachments #{current_path}/public/attachments"
38 end
39
bf8f94f @gma Push config.yml during setup, symlink it into current on update.
authored
40 task :update do
374bdc6 @gma Added the deploy rake task, for updating and restarting the app server.
authored
41 Rake::Task["vlad:symlink_config_yml"].invoke
42 Rake::Task["vlad:symlink_attachments"].invoke
bf8f94f @gma Push config.yml during setup, symlink it into current on update.
authored
43 end
374bdc6 @gma Added the deploy rake task, for updating and restarting the app server.
authored
44
6065b1d @gma Added example vlad:bundle task.
authored
45 remote_task :bundle do
46 run "cd #{current_path} && sudo bundle install --without development test"
47 end
48
374bdc6 @gma Added the deploy rake task, for updating and restarting the app server.
authored
49 # Depending on how you host Nesta, you might want to swap :start_app
6065b1d @gma Added example vlad:bundle task.
authored
50 # with :start below. The :start_app task will tell your application
51 # server (e.g. Passenger) to restart once your new code is deployed by
52 # :update. Passenger is the default app server; tell Vlad that you're
53 # using a different app server in the call to Vlad.load in Rakefile.
54 #
374bdc6 @gma Added the deploy rake task, for updating and restarting the app server.
authored
55 desc "Deploy the code and restart the server"
56 task :deploy => [:update, :start_app]
6065b1d @gma Added example vlad:bundle task.
authored
57
58 # If you use bundler to manage the installation of gems on your server
59 # you can use this definition of the deploy task instead:
60 #
61 # task :deploy => [:update, :bundle, :start_app]
cb31525 @gma More work on the vlad deployment recipes.
authored
62 end
Something went wrong with that request. Please try again.