diff --git a/Gemfile b/Gemfile index 65e7f90..41541aa 100644 --- a/Gemfile +++ b/Gemfile @@ -118,16 +118,3 @@ gem 'yard' gem 'redcarpet' -# -# API -# -gem 'swagger-docs' - -# ======================================================================================= -# DMPTool specific configuration (DO NOT contribute back to the DMPRoadmap/roadmap repo) -# ======================================================================================= -gem 'capistrano' -gem 'capistrano-bundler' -gem 'capistrano-passenger' -gem 'capistrano-rails' -gem 'passenger' \ No newline at end of file diff --git a/config/deploy.rb b/config/deploy.rb deleted file mode 100644 index f37fbee..0000000 --- a/config/deploy.rb +++ /dev/null @@ -1,109 +0,0 @@ -set :application, 'dmptool' -set :repo_url, 'https://github.com/CDLUC3/roadmap.git' - -#set :user, 'dmp' - -# Default branch is :master -ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp unless ENV['BRANCH'] -set :branch, ENV['BRANCH'] if ENV['BRANCH'] - -# Default deploy_to directory is /var/www/my_app_name -set :deploy_to, '/dmp/apps/roadmap' -set :share_to, 'dmp/apps/roadmap/shared' - -# Default value for :scm is :git -# set :scm, :git - -# Default value for :format is :airbrussh. -# set :format, :airbrussh - -# You can configure the Airbrussh format using :format_options. -# These are the defaults. -# set :format_options, command_output: true, log_file: 'log/capistrano.log', color: :auto, truncate: :auto - -# Default value for :pty is false -# set :pty, true - -# Default value for :linked_files is [] -append :linked_files, 'config/database.yml', 'config/secrets.yml' - -# Default value for linked_dirs is [] -append :linked_dirs, 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system' - -# Default value for default_env is {} -set :default_env, { path: "/dmp/local/bin:$PATH" } - -# Default value for keep_releases is 5 -set :keep_releases, 5 - -# passenger in gemfile set since we have both passenger and capistrano-passenger in gemfile -set :passenger_in_gemfile, true - -# Set whether to restart with touch of touch of tmp/restart.txt. -# There may be difficulties one way or another. Normal restart may require sudo in some circumstances. -set :passenger_restart_with_touch, false - -namespace :deploy do - - desc 'Restart Phusion' - task :restart do - on roles(:app), wait: 5 do - # Your restart mechanism here, for example: - invoke 'deploy:stop' - invoke 'deploy:start' - end - end - - after :restart, :clear_cache do - on roles(:web), in: :groups, limit: 3, wait: 10 do - # Here we can do anything such as: - # within release_path do - # execute :rake, 'cache:clear' - # end - end - end - - desc 'Start Phusion' - task :start do - on roles(:app) do - within current_path do - with rails_env: fetch(:rails_env) do - execute "cd #{deploy_to}/current; bundle install --no-deployment" - execute "cd #{deploy_to}/current; bundle exec passenger start -d --environment #{fetch(:rails_env)} --pid-file #{fetch(:passenger_pid)} -p #{fetch(:passenger_port)} --log-file #{fetch(:passenger_log)}" - end - end - end - end - - desc 'Stop Phusion' - task :stop do - on roles(:app) do - if test("[ -f #{fetch(:passenger_pid)} ]") - execute "cd #{deploy_to}/current; bundle exec passenger stop --pid-file #{fetch(:passenger_pid)}" - end - end - end - -=begin - Rake::Task["cleanup"].clear_actions - desc "Clean up old releases" - task :cleanup do - on release_roles :all do |host| - releases = capture(:ls, "-xtr", releases_path).split.keep_if{|i| i.match(/^[0-9]+$/) } - if releases.count >= fetch(:keep_releases) - info t(:keeping_releases, host: host.to_s, keep_releases: fetch(:keep_releases), releases: releases.count) - directories = (releases - releases.last(fetch(:keep_releases))) - if directories.any? - directories_str = directories.map do |release| - releases_path.join(release) - end.join(" ") - execute :rm, "-rf", directories_str - else - info t(:no_old_releases, host: host.to_s, keep_releases: fetch(:keep_releases)) - end - end - end - end -=end - -end \ No newline at end of file diff --git a/config/deploy/development.rb b/config/deploy/development.rb deleted file mode 100644 index 848f00f..0000000 --- a/config/deploy/development.rb +++ /dev/null @@ -1,68 +0,0 @@ -# server-based syntax -# ====================== -# Defines a single server with a list of roles and multiple properties. -# You can define all roles on a single server, or split them: -set :server_host, ENV["SERVER_HOST"] || 'uc3-roadmap-dev.cdlib.org' -server fetch(:server_host), user: 'dmp', roles: %w{web app db} - -# role-based syntax -# ================== - -# Defines a role with one or multiple servers. The primary server in each -# group is considered to be the first unless any hosts have the primary -# property set. Specify the username and a domain or IP for the server. -# Don't use `:all`, it's a meta role. - -#role :app, %w{uc3-roadmap-dev.cdlib.org} -#role :web, %w{uc3-roadmap-dev.cdlib.org} -#role :db, %w{uc3-roadmap-dev.cdlib.org} - -# Configuration -# ============= -# You can set any configuration variable like in config/deploy.rb -# These variables are then only loaded and set in this stage. -# For available Capistrano configuration variables see the documentation page. -# http://capistranorb.com/documentation/getting-started/configuration/ -# Feel free to add new variables to customise your setup. - -#set :sudo, true - -#on 'uc3-roadmap-dev.cdlib.org' do -# execute :sudo, 'su - dmp' - - #as(user: 'dmp', group: 'dmp') do - # :deploy - #end -#end - -# Custom SSH Options -# ================== -# You may pass any option but keep in mind that net/ssh understands a -# limited set of options, consult the Net::SSH documentation. -# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start -# -# Global options -# -------------- -# set :ssh_options, { -# keys: %w(/home/rlisowski/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(password) -# } -# -# The server-based syntax can be used to override options: -# ------------------------------------ -# server 'example.com', -# user: 'user_name', -# roles: %w{web app}, -# ssh_options: { -# user: 'user_name', # overrides user setting above -# keys: %w(/home/user_name/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(publickey password) -# # password: 'please use keys' -# } - -set :rails_env, 'development' -set :passenger_log, "/dmp/apps/roadmap/shared/log/passenger.log" -set :passenger_pid, "/dmp/apps/roadmap/shared/tmp/pids/passenger.pid" -set :passenger_port, "3000" \ No newline at end of file diff --git a/config/deploy/production.rb b/config/deploy/production.rb deleted file mode 100644 index 4fc06fa..0000000 --- a/config/deploy/production.rb +++ /dev/null @@ -1,61 +0,0 @@ -# server-based syntax -# ====================== -# Defines a single server with a list of roles and multiple properties. -# You can define all roles on a single server, or split them: - -# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value -# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value -# server 'db.example.com', user: 'deploy', roles: %w{db} - - - -# role-based syntax -# ================== - -# Defines a role with one or multiple servers. The primary server in each -# group is considered to be the first unless any hosts have the primary -# property set. Specify the username and a domain or IP for the server. -# Don't use `:all`, it's a meta role. - -# role :app, %w{deploy@example.com}, my_property: :my_value -# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value -# role :db, %w{deploy@example.com} - - - -# Configuration -# ============= -# You can set any configuration variable like in config/deploy.rb -# These variables are then only loaded and set in this stage. -# For available Capistrano configuration variables see the documentation page. -# http://capistranorb.com/documentation/getting-started/configuration/ -# Feel free to add new variables to customise your setup. - - - -# Custom SSH Options -# ================== -# You may pass any option but keep in mind that net/ssh understands a -# limited set of options, consult the Net::SSH documentation. -# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start -# -# Global options -# -------------- -# set :ssh_options, { -# keys: %w(/home/rlisowski/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(password) -# } -# -# The server-based syntax can be used to override options: -# ------------------------------------ -# server 'example.com', -# user: 'user_name', -# roles: %w{web app}, -# ssh_options: { -# user: 'user_name', # overrides user setting above -# keys: %w(/home/user_name/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(publickey password) -# # password: 'please use keys' -# } diff --git a/config/deploy/stage.rb b/config/deploy/stage.rb deleted file mode 100644 index 4fc06fa..0000000 --- a/config/deploy/stage.rb +++ /dev/null @@ -1,61 +0,0 @@ -# server-based syntax -# ====================== -# Defines a single server with a list of roles and multiple properties. -# You can define all roles on a single server, or split them: - -# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value -# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value -# server 'db.example.com', user: 'deploy', roles: %w{db} - - - -# role-based syntax -# ================== - -# Defines a role with one or multiple servers. The primary server in each -# group is considered to be the first unless any hosts have the primary -# property set. Specify the username and a domain or IP for the server. -# Don't use `:all`, it's a meta role. - -# role :app, %w{deploy@example.com}, my_property: :my_value -# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value -# role :db, %w{deploy@example.com} - - - -# Configuration -# ============= -# You can set any configuration variable like in config/deploy.rb -# These variables are then only loaded and set in this stage. -# For available Capistrano configuration variables see the documentation page. -# http://capistranorb.com/documentation/getting-started/configuration/ -# Feel free to add new variables to customise your setup. - - - -# Custom SSH Options -# ================== -# You may pass any option but keep in mind that net/ssh understands a -# limited set of options, consult the Net::SSH documentation. -# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start -# -# Global options -# -------------- -# set :ssh_options, { -# keys: %w(/home/rlisowski/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(password) -# } -# -# The server-based syntax can be used to override options: -# ------------------------------------ -# server 'example.com', -# user: 'user_name', -# roles: %w{web app}, -# ssh_options: { -# user: 'user_name', # overrides user setting above -# keys: %w(/home/user_name/.ssh/id_rsa), -# forward_agent: false, -# auth_methods: %w(publickey password) -# # password: 'please use keys' -# }