Commit 0c61a17c1429517df2bfaaf98f89f0c44e7c29ec
- Diff rendering mode:
- inline
- side by side
config/deploy.rb
(25 / 35)
|   | |||
| 16 | 16 | set :scm, :git | |
| 17 | 17 | set :ssh_options, { :forward_agent => true } | |
| 18 | 18 | set :repository, "/var/git/#{application}/mainline.git" | |
| 19 | set :branch, "sonian" | ||
| 19 | 20 | set :repository_cache, "git-cache" | |
| 20 | # set :branch, "master" | ||
| 21 | 21 | set :deploy_to, "/var/www/#{application}" | |
| 22 | 22 | set :deploy_via, :remote_cache | |
| 23 | 23 | ||
| 24 | DATABASE_YML = ERB.new <<-EOF | ||
| 25 | base: &base | ||
| 26 | adapter: mysql | ||
| 27 | socket: /var/run/mysqld/mysqld.sock | ||
| 28 | username: root | ||
| 29 | password: | ||
| 30 | development: | ||
| 31 | database: #{application}_development | ||
| 32 | <<: *base | ||
| 33 | test: | ||
| 34 | database: #{application}_test | ||
| 35 | <<: *base | ||
| 36 | production: | ||
| 37 | database: #{application}_production | ||
| 38 | <<: *base | ||
| 39 | EOF | ||
| 40 | |||
| 41 | GITORIOUS_YML = ERB.new <<-EOF | ||
| 42 | cookie_secret: d11c9229c49301cc6c307279b689396b | ||
| 43 | repository_base_path: /var/git | ||
| 44 | extra_html_head_data: | ||
| 45 | system_message: | ||
| 46 | gitorious_client_port: 3000 | ||
| 47 | gitorious_client_host: localhost | ||
| 48 | gitorious_host: git.sonianarchive.com | ||
| 49 | EOF | ||
| 50 | |||
| 51 | 24 | after "deploy:setup" do | |
| 52 | 25 | run "mkdir -p #{shared_path}/config" | |
| 53 | put DATABASE_YML.result, "#{shared_path}/config/database.yml" | ||
| 54 | put GITORIOUS_YML.result, "#{shared_path}/config/gitorious.yml" | ||
| 26 | |||
| 27 | db_yml = ERB.new """ | ||
| 28 | production: | ||
| 29 | adapter: mysql | ||
| 30 | socket: /var/run/mysqld/mysqld.sock | ||
| 31 | database: #{application}_production | ||
| 32 | username: root | ||
| 33 | """ | ||
| 34 | put db_yml.result, "#{shared_path}/config/database.yml" | ||
| 35 | |||
| 36 | gitorious_yml = ERB.new """ | ||
| 37 | cookie_secret: d11c9229c49301cc6c307279b689396b | ||
| 38 | repository_base_path: /var/git | ||
| 39 | extra_html_head_data: | ||
| 40 | system_message: | ||
| 41 | gitorious_client_port: 3000 | ||
| 42 | gitorious_client_host: localhost | ||
| 43 | gitorious_host: git.sonianarchive.com | ||
| 44 | """ | ||
| 45 | put gitorious_yml.result, "#{shared_path}/config/gitorious.yml" | ||
| 46 | |||
| 55 | 47 | run "umask 02 && mkdir -p #{shared_path}/public/images/graphs" | |
| 56 | 48 | end | |
| 57 | 49 | ||
| 58 | 50 | after "deploy:update_code" do | |
| 59 | run "ln -nfs #{shared_path}/config/database.yml \ | ||
| 60 | #{release_path}/config/database.yml" | ||
| 61 | run "ln -nfs #{shared_path}/config/gitorious.yml \ | ||
| 62 | #{release_path}/config/gitorious.yml" | ||
| 51 | run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/" | ||
| 52 | run "ln -nfs #{shared_path}/config/gitorious.yml #{release_path}/config/" | ||
| 63 | 53 | run "ln -nfs #{shared_path}/public/images/graphs \ | |
| 64 | #{release_path}/public/images/graphs" | ||
| 54 | #{release_path}/public/images/" | ||
| 65 | 55 | end | |
| 66 | 56 | ||
| 67 | 57 | namespace :deploy do |

