|
| 1 | +set :use_sudo, :false |
| 2 | + |
| 3 | +if ENV['environment'] == "production" |
| 4 | + set :application, "xerte" |
| 5 | + role :app, "172.20.1.63" |
| 6 | + role :web, "172.20.1.63" |
| 7 | + role :db, "172.20.1.63", :primary => true |
| 8 | + set :keep_releases, 3 |
| 9 | +else |
| 10 | + set :application, "xerte_dev" |
| 11 | + role :app, "webdev.southdevon.ac.uk" |
| 12 | + role :web, "webdev.southdevon.ac.uk" |
| 13 | + role :db, "webdev.southdevon.ac.uk", :primary => true |
| 14 | + set :keep_releases, 3 |
| 15 | +end |
| 16 | + |
| 17 | +default_run_options[:pty] = true |
| 18 | + |
| 19 | +set :repository, "[email protected]:sdc/xerte.git" |
| 20 | +set :branch, "master" |
| 21 | +set :deploy_to, "/srv/#{application}" |
| 22 | +set :scm, :git |
| 23 | + |
| 24 | +namespace :deploy do |
| 25 | + %W(start stop restart migrate finalize_update).each do |event| |
| 26 | + task event do |
| 27 | + # don't |
| 28 | + end |
| 29 | + end |
| 30 | +end |
| 31 | + |
| 32 | +after "deploy:create_symlink" do |
| 33 | + run "cp #{shared_path}/database.php #{current_path}/" |
| 34 | + run "chmod a+rwx #{current_path}" |
| 35 | + run "chmod a+rwx #{current_path}/error_logs" |
| 36 | + run "chmod a+rwx #{current_path}/import" |
| 37 | + |
| 38 | + run "rm -rf #{current_path}/USER-FILES" |
| 39 | + run "ln -s #{shared_path}/userfiles #{current_path}/USER-FILES" |
| 40 | + run "chmod a+rwx #{current_path}/USER-FILES" |
| 41 | +end |
0 commit comments