1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

SwitchTower: specify the revision to release via the :revision variable (defaults to latest revision)

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2062 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2005-08-27 21:16:30 +00:00
parent 76e7de61c9
commit 4e4a35aed9
7 changed files with 11 additions and 6 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Specify the revision to release via the :revision variable (defaults to latest revision)
* Allow variables to be set via the cli using the -s switch
* Log checkouts to a "revisions.log" file

View file

@ -44,12 +44,14 @@ module SwitchTower
set :user, nil
set :password, nil
set :deploy_to, Proc.new { "/u/apps/#{application}" }
set :deploy_to, Proc.new { "/u/apps/#{application}" }
set :version_dir, DEFAULT_VERSION_DIR_NAME
set :current_dir, DEFAULT_CURRENT_DIR_NAME
set :shared_dir, DEFAULT_SHARED_DIR_NAME
set :scm, :subversion
set :revision, Proc.new { source.latest_revision }
end
# Set a variable to the given value.

View file

@ -71,7 +71,7 @@ symlinks and deleting the current release from all servers.
DESC
task :rollback_code do
if releases.length < 2
raise "could not rollback the code because there is no previous version"
raise "could not rollback the code because there is no prior release"
else
run <<-CMD
ln -nfs #{previous_release} #{current_path} &&

View file

@ -22,7 +22,7 @@ module SwitchTower
command = <<-STR
if [[ ! -d #{configuration.release_path} ]]; then
#{guts}
echo `date +"%Y-%m-%d %H:%M:%S"` $USER #{latest_revision} #{directory} >> #{log};
echo `date +"%Y-%m-%d %H:%M:%S"` $USER #{configuration.revision} #{directory} >> #{log};
chmod 666 #{log};
fi
STR

View file

@ -45,7 +45,7 @@ module SwitchTower
command = <<-CMD
cd #{configuration.releases_path};
CVS_RSH="#{cvs_rsh}" #{cvs} -d #{configuration.repository} -Q co -D "#{latest_revision}" -d #{File.basename(actor.release_path)} #{actor.application};
CVS_RSH="#{cvs_rsh}" #{cvs} -d #{configuration.repository} -Q co -D "#{configuration.revision}" -d #{File.basename(actor.release_path)} #{actor.application};
CMD
run_checkout(actor, command) do |ch, stream, out|

View file

@ -18,7 +18,8 @@ module SwitchTower
# revision. Uses the given actor instance to execute the command.
def checkout(actor)
darcs = configuration[:darcs] ? configuration[:darcs] : "darcs"
run_checkout(actor, "#{darcs} get -q --set-scripts-executable #{configuration.repository} #{actor.release_path};")
revision = configuration[:revision] ? %(--to-match "#{configuration.revision}") : ""
run_checkout(actor, "#{darcs} get -q --set-scripts-executable #{revision} #{configuration.repository} #{actor.release_path};")
end
end

View file

@ -42,7 +42,7 @@ module SwitchTower
def checkout(actor)
svn = configuration[:svn] ? configuration[:svn] : "svn"
command = "#{svn} co -q -r#{latest_revision} #{configuration.repository} #{actor.release_path};"
command = "#{svn} co -q -r#{configuration.revision} #{configuration.repository} #{actor.release_path};"
run_checkout(actor, command) do |ch, stream, out|
prefix = "#{stream} :: #{ch[:host]}"