Commit c9e36ef5c753210511d36d712fa620aa1705688d

got a basic git/ebb cap deploy working
  
1set :application, "set your application name here"
2set :repository, "set your repository location here"
1set :application, 'gitorious'
32
4# If you aren't deploying to /u/apps/#{application} on the target
5# servers (which is the default), you can specify the actual location
6# via the :deploy_to variable:
7# set :deploy_to, "/var/www/#{application}"
3role :app, 'int.sonianarchive.com'
4role :web, 'int.sonianarchive.com'
5role :db, 'int.sonianarchive.com', :primary => true
86
9# If you aren't using Subversion to manage your source code, specify
10# your SCM below:
11# set :scm, :subversion
7depend :remote, :command, 'gem'
8depend :remote, :gem, 'rails', '>=2.0.2'
9depend :remote, :gem, 'ebb', '>=0.1.0'
10depend :remote, :gem, 'BlueCloth', '>=1.0.0'
11depend :remote, :gem, 'mime-types', '>=1.15'
12depend :remote, :gem, 'textpow', '>=0.10.1'
13depend :remote, :gem, 'chronic', '>=0.2.3'
14depend :remote, :gem, 'rmagick', '>=2.3.0'
1215
13role :app, "your app-server here"
14role :web, "your web-server here"
15role :db, "your db-server here", :primary => true
16set :use_sudo, false
17set :user, 'git'
18set :deploy_to, "/var/www/#{application}"
19
20set :scm, :git
21set :repository, "/var/git/#{application}.git"
22set :repository_cache, "git-cache"
23set :ssh_options, { :forward_agent => true }
24set :deploy_via, :remote_cache
25set :branch, "sonian"
26
27DATABASE_YML = ERB.new <<-EOF
28base: &base
29 adapter: mysql
30 socket: /var/run/mysqld/mysqld.sock
31 username: root
32 password:
33development:
34 database: #{application}_development
35 <<: *base
36test:
37 database: #{application}_test
38 <<: *base
39production:
40 database: #{application}_production
41 <<: *base
42EOF
43
44GITORIOUS_YML = ERB.new <<-EOF
45cookie_secret: d11c9229c49301cc6c307279b689396b
46repository_base_path: /var/git
47extra_html_head_data:
48system_message:
49gitorious_client_port: 3000
50gitorious_client_host: localhost
51gitorious_host: int.sonianarchive.com
52EOF
53
54after "deploy:setup" do
55 run "mkdir -p #{shared_path}/config"
56 put DATABASE_YML.result, "#{shared_path}/config/database.yml"
57 put GITORIOUS_YML.result, "#{shared_path}/config/gitorious.yml"
58end
59
60after "deploy:update_code" do
61 run "ln -nfs #{shared_path}/config/database.yml \
62 #{release_path}/config/database.yml"
63 run "ln -nfs #{shared_path}/config/gitorious.yml \
64 #{release_path}/config/gitorious.yml"
65end
66
67namespace :deploy do
68 namespace :monit do
69 [ :stop, :start, :restart ].each do |t|
70 desc "#{t.to_s.capitalize} #{application}"
71 task t, :roles => :app do
72 invoke_command "monit -g #{application} #{t.to_s} all",
73 :via => run_method
74 end
75 end
76 end
77
78 desc "start #{application}"
79 task :start, :roles => :app do
80 deploy.monit.start
81 end
82
83 desc "stop #{application}"
84 task :stop, :roles => :app do
85 deploy.monit.stop
86 end
87
88 desc "restart #{application}"
89 task :restart, :roles => :app, :except => { :no_release => true } do
90 deploy.monit.restart
91 end
92end