Skip to content

Commit

Permalink
Merge pull request #896 from sul-dlss/deploy-changes
Browse files Browse the repository at this point in the history
Support sub-directory deploys in -test.
  • Loading branch information
jchristo4 committed Sep 11, 2014
2 parents 9580367 + a8987c1 commit 2f875b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ require 'capistrano/deploy'
# require 'capistrano/rails/assets'
# require 'capistrano/rails/migrations'
require 'capistrano/bundler'
require 'capistrano/rvm'
require 'capistrano/rails'
require 'dlss/capistrano'
require 'squash/rails/capistrano3'
Expand Down
8 changes: 2 additions & 6 deletions config/deploy/testing.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
set :keep_releases, 50
set :keep_releases, 70

set :deploy_host, ask("Server", 'e.g. server.stanford.edu')

set :sub_dir, "redesign"
set :sub_dir, ask('Deploy directory', 'e.g. gdor')
set :symlinks_directory, "#{fetch(:home_directory)}/SearchWorksSubURIs"
set :symlink_deploy_path, "#{fetch(:symlinks_directory)}/#{fetch(:sub_dir)}"
set :bundle_without, %w{production test}.join(' ')

set :rvm_ruby_version, '2.1.0'

task :symlink_sub_directory_deploy do
on roles(:app), wait: 1 do
set :last_release, capture("ls #{releases_path}").split("\n").last
set :last_release_path, "#{releases_path}/#{fetch(:last_release)}"
set :public_release_path, "#{fetch(:last_release_path)}/public"
# Write .htaccess file with RailsBaseURI directive
execute("echo 'RailsBaseURI /#{fetch(:sub_dir)}' > #{fetch(:public_release_path)}/.htaccess")
execute("echo 'PassengerRuby /usr/local/rvm/wrappers/ruby-2.1.0-preview2/ruby' >> #{fetch(:public_release_path)}/.htaccess")
# Remove symlink if it already exists
execute("rm #{fetch(:symlink_deploy_path)}") if sub_uri_exists? fetch(:symlink_deploy_path)
# Symlink release's public directory
Expand Down

0 comments on commit 2f875b0

Please sign in to comment.