From 28ec8224d37f14a44e6c88fcb9aa46d4b140a61c Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Tue, 11 Jun 2013 10:28:22 -0400 Subject: [PATCH] Delete capistrano files; they have been moved to a separate repository. --- services/api/.gitignore | 5 ++ services/api/Capfile | 3 - services/api/Capfile.ant | 3 - services/api/config/deploy.ant.rb | 62 ------------------ services/api/config/deploy.common.rb | 16 ----- services/api/config/deploy.rb | 96 ---------------------------- 6 files changed, 5 insertions(+), 180 deletions(-) delete mode 100644 services/api/Capfile delete mode 100644 services/api/Capfile.ant delete mode 100644 services/api/config/deploy.ant.rb delete mode 100644 services/api/config/deploy.common.rb delete mode 100644 services/api/config/deploy.rb diff --git a/services/api/.gitignore b/services/api/.gitignore index d6b08d646b..73417aacf5 100644 --- a/services/api/.gitignore +++ b/services/api/.gitignore @@ -32,3 +32,8 @@ # editor backup files *~ + +# Capistrano files are coming from another repo +/Capfile* + +/config/deploy* diff --git a/services/api/Capfile b/services/api/Capfile deleted file mode 100644 index 8a7ea65d11..0000000000 --- a/services/api/Capfile +++ /dev/null @@ -1,3 +0,0 @@ -load 'deploy' -load 'config/deploy.common' -load 'config/deploy' diff --git a/services/api/Capfile.ant b/services/api/Capfile.ant deleted file mode 100644 index 56b0e8e80e..0000000000 --- a/services/api/Capfile.ant +++ /dev/null @@ -1,3 +0,0 @@ -load 'deploy' -load 'config/deploy.common' -load 'config/deploy.ant' diff --git a/services/api/config/deploy.ant.rb b/services/api/config/deploy.ant.rb deleted file mode 100644 index a30e720705..0000000000 --- a/services/api/config/deploy.ant.rb +++ /dev/null @@ -1,62 +0,0 @@ -set :application, "orvos-server" -set :domain, "orvos.ant" -set :deploy_to, "/var/www/7tzkq.orvosapi.com" -role :web, "orvos.ant" -role :app, "orvos.ant" -role :db, "orvos.ant", :primary=>true -set :scm, :git -set :repository, "git@git.clinicalfuture.com:orvos-server.git" -set :rails_env, "production" -set :config_files, ['database.yml'] -set :git_enable_submodules, true -set :rvm_ruby_string, '1.9.3' -require "rvm/capistrano" -load "deploy/assets" -default_run_options[:shell] = '/bin/bash --login' - -ssh_options[:forward_agent] = true -ssh_options[:user] = 'root' - -desc "Clean up old releases" -set :keep_releases, 5 -before("deploy:cleanup") { set :use_sudo, false } - -before "deploy:assets:precompile", "deploy:copy_files", :roles => :app -after "deploy:copy_files", "deploy:bundle_install", :roles => :app -after "deploy:update", "deploy:migrate", :roles => :db -after :deploy, 'deploy:cleanup', :roles => :app - -namespace :deploy do - desc "Put a few files in place, ensure correct file ownership" - task :copy_files, :roles => :app, :except => { :no_release => true } do - # Copy a few files/make a few symlinks - run "cp /home/passenger/orvos-server/database.yml #{release_path}/config/database.yml" - run "cp /home/passenger/orvos-server/secret_token.rb #{release_path}/config/initializers/secret_token.rb" - run "cp /home/passenger/orvos-server/production.rb #{release_path}/config/environments/production.rb" - run "cp /home/passenger/orvos-server/omniauth.rb #{release_path}/config/initializers/omniauth.rb" - # Ensure correct ownership of a few files - run "chown www-data:www-data #{release_path}/config/environment.rb" - run "chown www-data:www-data #{release_path}/config.ru" - run "chown www-data:www-data #{release_path}/config/database.yml" - # This is for the drb server - run "touch #{release_path}/Gemfile.lock" - run "chown www-data:www-data #{release_path}/Gemfile.lock" - # Keep track of the git commit used for this deploy - # This is used by the lib/add_debug_info.rb middleware, which injects it in the - # environment. - run "cd #{release_path}; /usr/bin/git rev-parse HEAD > #{release_path}/git-commit.version" - # make sure to symlink the vendor bundle. Cf. http://gembundler.com/rationale.html - run "cd #{release_path}; ln -s #{shared_path}/vendor_bundle #{release_path}/vendor/bundle" - end - - # desc "Install new gems if necessary" - task :bundle_install, :roles => :app, :except => { :no_release => true } do - run "cd #{release_path} && bundle install --deployment" - end - - desc "Restarting mod_rails with restart.txt" - task :restart, :roles => :app, :except => { :no_release => true } do - # Tell passenger to restart. - run "touch #{release_path}/tmp/restart.txt" - end -end diff --git a/services/api/config/deploy.common.rb b/services/api/config/deploy.common.rb deleted file mode 100644 index 3d3376dd8c..0000000000 --- a/services/api/config/deploy.common.rb +++ /dev/null @@ -1,16 +0,0 @@ -before 'deploy:update_code' do - local_branch = `git branch | egrep '^\\*' | cut -d' ' -f2`.strip - remote_commit = `git ls-remote '#{fetch(:repository)}' '#{local_branch}'`.strip.split.first - local_commit = `git show -s --format=format:%H`.strip - if !local_branch.match(/^(master$|production)/) - abort 'You cannot deploy unless your branch is called "master" or "production*"' - end - if local_commit != remote_commit - puts "Current branch is #{local_branch}" - puts "Last commit is #{local_commit} here" - puts "Last commit is #{remote_commit} on #{local_branch} at #{fetch(:repository)}" - abort "You cannot deploy unless HEAD = a branch = head of remote branch with same name." - end - puts "Setting deploy branch to #{local_branch}" - set :branch, local_branch -end diff --git a/services/api/config/deploy.rb b/services/api/config/deploy.rb deleted file mode 100644 index 669a948162..0000000000 --- a/services/api/config/deploy.rb +++ /dev/null @@ -1,96 +0,0 @@ -set :application, "orvos-server" -set :domain, "controller.van" -set :deploy_to, "/var/www/9ujm1.orvosapi.com" -role :web, "controller.van" -role :app, "controller.van" -role :db, "controller.van", :primary=>true -set :scm, :git -set :repository, "git@git.clinicalfuture.com:orvos-server.git" -set :rails_env, "production" -set :config_files, ['database.yml'] -set :git_enable_submodules, true -set :rvm_ruby_string, '1.9.3' -require "rvm/capistrano" -load "deploy/assets" -default_run_options[:shell] = '/bin/bash --login' -#default_run_options[:shell] = '/bin/bash' - -set :passenger_port, 3000 -#set :passenger_cmd, "#{bundle_cmd} exec passenger" -set :passenger_cmd, "passenger" - -ssh_options[:forward_agent] = true -ssh_options[:user] = 'root' - -desc "Clean up old releases" -set :keep_releases, 5 -before("deploy:cleanup") { set :use_sudo, false } - -before "deploy:assets:precompile", "deploy:copy_files", :roles => :app -after "deploy:copy_files", "deploy:bundle_install", :roles => :app -after "deploy:update", "deploy:migrate", :roles => :db -after :deploy, 'deploy:cleanup', :roles => :app - -namespace :deploy do - desc "Put a few files in place, ensure correct file ownership" - task :copy_files, :roles => :app, :except => { :no_release => true } do - # Copy a few files/make a few symlinks - run "cp /home/passenger/orvos-server/database.yml #{release_path}/config/database.yml" - run "cp /home/passenger/orvos-server/secret_token.rb #{release_path}/config/initializers/secret_token.rb" - run "cp /home/passenger/orvos-server/production.rb #{release_path}/config/environments/production.rb" - run "cp /home/passenger/orvos-server/omniauth.rb #{release_path}/config/initializers/omniauth.rb" - # Ensure correct ownership of a few files - run "chown www-data:www-data #{release_path}/config/environment.rb" - run "chown www-data:www-data #{release_path}/config.ru" - run "chown www-data:www-data #{release_path}/config/database.yml" - # This is for the drb server - run "touch #{release_path}/Gemfile.lock" - run "chown www-data:www-data #{release_path}/Gemfile.lock" - # Keep track of the git commit used for this deploy - # This is used by the lib/add_debug_info.rb middleware, which injects it in the - # environment. - run "cd #{release_path}; /usr/bin/git rev-parse HEAD > #{release_path}/git-commit.version" - # make sure to symlink the vendor bundle. Cf. http://gembundler.com/rationale.html - run "cd #{release_path}; ln -s #{shared_path}/vendor_bundle #{release_path}/vendor/bundle" - end - - # desc "Install new gems if necessary" - task :bundle_install, :roles => :app, :except => { :no_release => true } do - run "cd #{release_path} && bundle install --deployment" - end - - desc "Restarting mod_rails with restart.txt" -# task :restart, :roles => :app, :except => { :no_release => true } do -# # Tell passenger to restart. -# #run "touch #{release_path}/tmp/restart.txt" -# run "cd #{release_path}; passenger stop" -# run "cd #{release_path}; passenger start -a 127.0.0.1 -p 3000 -d" -# # Tell DRB to restart. -# #run "/usr/sbin/monit restart mypg_server.rb" -# end -# [:start, :stop].each do |t| -# desc "#{t} task is a no-op with mod_rails" -# task t, :roles => :app do ; end -# end - - # Use standalone passenger because we also run gps on this box, on a different ruby/passenger version... - task :start, :roles => :app, :except => { :no_release => true } do - run "cd #{release_path} && #{passenger_cmd} start -e #{rails_env} -p #{passenger_port} -d" - end - - task :stop, :roles => :app, :except => { :no_release => true } do - run "cd #{previous_release} && #{passenger_cmd} stop -p #{passenger_port}" - end - - task :restart, :roles => :app, :except => { :no_release => true } do - run <<-CMD - if [[ -f #{previous_release}/tmp/pids/passenger.#{passenger_port}.pid ]]; then - cd #{previous_release} && #{passenger_cmd} stop -p #{passenger_port}; - fi - CMD - - run "cd #{release_path} && #{passenger_cmd} start -e #{rails_env} -p #{passenger_port} -d" - run "sv term /etc/service/dispatch_jobs" - end - -end -- 2.30.2