3 set :application, "software"
7 set :repository, "git://gitorious.org/opensuse/software-o-o.git"
9 set :deploy_via, :remote_cache
10 set :git_enable_submodules, 1
11 set :migrate_target, :current
12 set :runit_name, "software"
14 set :deploy_notification_to, ['tschmidt@suse.de', 'coolo@suse.de']
15 server "buildserviceapi.suse.de", :app, :web, :db, :primary => true
17 # If you aren't deploying to /u/apps/#{application} on the target
18 # servers (which is the default), you can specify the actual location
19 # via the :deploy_to variable:
20 set :deploy_to, "/srv/www/vhosts/opensuse.org/#{application}"
21 set :static, "software.o.o"
23 # set variables for different target deployments
25 set :deploy_to, "/srv/www/vhosts/opensuse.org/stage/#{application}"
26 set :runit_name, "software_stage"
27 set :branch, "derivates"
28 set :static, "software.o.o-stage/stage"
32 ssh_options[:forward_agent] = true
33 default_run_options[:pty] = true
34 set :normalize_asset_timestamps, false
36 # tasks are run with this user
38 # spinner is run with this user
41 after "deploy:update_code", "config:symlink_shared_config"
42 after "deploy:update_code", "config:sync_static"
43 after "deploy:symlink", "config:permissions"
44 after "deploy:finalize_update", "deploy:notify"
46 after :deploy, 'deploy:cleanup' # only keep 5 releases
51 desc "Install saved configs from /shared/ dir"
52 task :symlink_shared_config do
53 run "rm #{release_path}/config/environments/production.rb"
54 run "ln -s #{shared_path}/production.rb #{release_path}/config/environments/"
55 run "rm -f #{release_path}/config/database.yml"
56 run "ln -s #{shared_path}/database.yml #{release_path}/config/database.yml"
57 run "rm -r #{release_path}/tmp/cache"
58 run "ln -s #{shared_path}/software.o.o.cache #{release_path}/tmp/cache"
61 desc "Set permissions"
63 run "chown -R lighttpd #{current_path}/db #{current_path}/tmp #{current_path}/tmp/cache/ #{current_path}/log #{current_path}/public"
66 desc "Sync public to static.o.o"
68 `rsync --delete-after --exclude=themes -av public/ -e 'ssh -p2212' proxy-opensuse.suse.de:/srv/www/vhosts/static.opensuse.org/hosts/#{static}`
75 run "sv start /service/#{runit_name}-*"
79 run "for i in /service/#{runit_name}-*; do sv restart $i; sleep 3; done"
83 run "sv stop /service/#{runit_name}-*"
87 desc "Send email notification of deployment"
89 #diff = `#{source.local.diff(current_revision)}`
91 diff_log = `#{source.local.log( source.next_revision(current_revision) )}`
93 diff_log = "No REVISION found, probably initial deployment."
96 body = %Q[From: software-deploy@suse.de
97 To: #{deploy_notification_to.join(", ")}
98 Subject: software deployed by #{user}
103 Net::SMTP.start('relay.suse.de', 25) do |smtp|
104 smtp.send_message body, 'software-deploy@suse.de', deploy_notification_to