You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by as...@apache.org on 2009/02/13 10:16:07 UTC

svn commit: r744049 - in /buildr/trunk/rakelib: apache.rake doc.rake release.rake rspec.rake stage.rake

Author: assaf
Date: Fri Feb 13 09:16:04 2009
New Revision: 744049

URL: http://svn.apache.org/viewvc?rev=744049&view=rev
Log:
Started simplifying release process, and using rake site to upload new Web site

Modified:
    buildr/trunk/rakelib/apache.rake
    buildr/trunk/rakelib/doc.rake
    buildr/trunk/rakelib/release.rake
    buildr/trunk/rakelib/rspec.rake
    buildr/trunk/rakelib/stage.rake

Modified: buildr/trunk/rakelib/apache.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/apache.rake?rev=744049&r1=744048&r2=744049&view=diff
==============================================================================
--- buildr/trunk/rakelib/apache.rake (original)
+++ buildr/trunk/rakelib/apache.rake Fri Feb 13 09:16:04 2009
@@ -55,40 +55,40 @@
   end
 
 
-  file 'staged/distro'=>'package' do
+  file '_staged'=>'package' do
     puts 'Copying and signing release files ...'
-    mkpath 'staged/distro'
+    mkpath '_staged'
     FileList['pkg/*.{gem,zip,tgz}'].each do |pkg|
-      cp pkg, pkg.pathmap('staged/distro/%n%x') 
+      cp pkg, pkg.pathmap('_staged/%n%x') 
     end
   end
 
-  task 'sign'=>['etc/KEYS', 'staged/distro'] do |task, args|
+  task 'sign'=>['etc/KEYS', '_staged'] do |task, args|
     gpg_user = args.gpg_user or fail "Please run with gpg_user=<argument for gpg --local-user>"
-    puts "Signing packages in staged/distro as user #{gpg_user}"
-    FileList['staged/distro/*.{gem,zip,tgz}'].each do |pkg|
+    puts "Signing packages in _staged as user #{gpg_user}"
+    FileList['_staged/*.{gem,zip,tgz}'].each do |pkg|
       bytes = File.open(pkg, 'rb') { |file| file.read }
       File.open(pkg + '.md5', 'w') { |file| file.write Digest::MD5.hexdigest(bytes) << ' ' << File.basename(pkg) }
       File.open(pkg + '.sha1', 'w') { |file| file.write Digest::SHA1.hexdigest(bytes) << ' ' << File.basename(pkg) }
       sh 'gpg', '--local-user', gpg_user, '--armor', '--output', pkg + '.asc', '--detach-sig', pkg, :verbose=>true
     end
-    cp 'etc/KEYS', 'staged/distro'
+    cp 'etc/KEYS', '_staged'
   end
 
-  # Publish prerequisites to distro server.
-  task 'publish:distro' do
+  # Publish prerequisites to dist server.
+  task 'dist:publish' do
     target = "people.apache.org:/www/www.apache.org/dist/#{spec.name}/#{spec.version}"
-    puts 'Uploading packages to Apache distro ...'
+    puts 'Uploading packages to Apache dist ...'
     host, remote_dir = target.split(':')
     sh 'ssh', host, 'rm', '-rf', remote_dir rescue nil
     sh 'ssh', host, 'mkdir', remote_dir
-    sh 'rsync', '--progress', '--recursive', 'published/distro/', target
+    sh 'rsync', '--progress', '--recursive', '_release/', target
     puts 'Done'
   end
 
-  task 'distro-links'=>'staged/distro' do
+  task 'dist-links'=>'_staged' do
     url = "http://www.apache.org/dist/#{spec.name}/#{spec.version}"
-    rows = FileList['staged/distro/*.{gem,tgz,zip}'].map { |pkg|
+    rows = FileList['_staged/*.{gem,tgz,zip}'].map { |pkg|
       name, md5 = File.basename(pkg), Digest::MD5.file(pkg).to_s
       %{| "#{name}":#{url}/#{name} | "#{md5}":#{url}/#{name}.md5 | "Sig":#{url}/#{name}.asc |}
     }
@@ -109,16 +109,12 @@
     puts 'Done'
   end
 
-  file 'staged/site'=>['distro-links', 'staged', 'site'] do
-    rm_rf 'staged/site'
-    cp_r 'site', 'staged'
-  end
 
   # Publish prerequisites to Web site.
-  task 'publish:site' do
+  task 'site:publish' do
     target = "people.apache.org:/www/#{spec.name}.apache.org"
     puts 'Uploading Apache Web site ...'
-    sh 'rsync', '--progress', '--recursive', '--delete', 'published/site/', target
+    sh 'rsync', '--progress', '--recursive', '--delete', '_site/', target
     puts 'Done'
   end
   
@@ -137,11 +133,11 @@
 Subject: [VOTE] Buildr #{spec.version} release
 
 We're voting on the source distributions available here:
-#{base_url}/distro/
+#{base_url}/dist/
 
 Specifically:
-#{base_url}/distro/buildr-#{spec.version}.tgz
-#{base_url}/distro/buildr-#{spec.version}.zip
+#{base_url}/dist/buildr-#{spec.version}.tgz
+#{base_url}/dist/buildr-#{spec.version}.zip
 
 The documentation generated for this release is available here:
 #{base_url}/site/
@@ -174,7 +170,7 @@
 
 
 task 'stage:check'=>['apache:check']
-task 'stage:prepare'=>['staged/distro', 'staged/site'] do |task|
+task 'stage:prepare'=>['_staged', '_site'] do |task|
   # Since this requires input (passphrase), do it at the very end.
   task.enhance do
     task('apache:sign').invoke
@@ -185,4 +181,4 @@
 end
 task 'stage:wrapup'=>'release-vote-email.txt'
 
-task 'release:publish'=>['apache:publish:distro', 'apache:publish:site']
+task 'release:publish'=>['apache:dist:publish', 'apache:site:publish']

Modified: buildr/trunk/rakelib/doc.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/doc.rake?rev=744049&r1=744048&r2=744049&view=diff
==============================================================================
--- buildr/trunk/rakelib/doc.rake (original)
+++ buildr/trunk/rakelib/doc.rake Fri Feb 13 09:16:04 2009
@@ -71,11 +71,11 @@
   task '_site/buildr.pdf'=>'buildr.pdf' do
     cp 'buildr.pdf', '_site'
   end
-  task '_site/specs.html'=>'_reports/specs.html' do
+  task '_site/specs.html'=>'spec' do
     cp '_reports/specs.html', '_site'
   end
-  task '_site/coverage'=>'_reports/coverage' do
-    cp '_reports/coverage', '_site'
+  task '_site/coverage'=>'coverage' do
+    cp_r '_reports/coverage', '_site'
   end
 
   task 'site'=>['_site', '_site/buildr.pdf', '_site/specs.html', '_site/coverage'] do
@@ -88,6 +88,16 @@
     puts 'OK'
   end
 
+
+  # Publish prerequisites to Web site.
+  task 'site_publish'=>'site' do
+    target = "people.apache.org:/www/#{spec.name}.apache.org"
+    puts "Uploading new site to #{target} ..."
+    sh "rsync --progress --recursive --delete _site/ #{target.inspect}/"
+    puts "Done"
+  end
+
+
   desc 'Produce PDF'
   task 'pdf'=>'_print/buildr.pdf' do |task|
     sh 'open', '_print/buildr.pdf'

Modified: buildr/trunk/rakelib/release.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/release.rake?rev=744049&r1=744048&r2=744049&view=diff
==============================================================================
--- buildr/trunk/rakelib/release.rake (original)
+++ buildr/trunk/rakelib/release.rake Fri Feb 13 09:16:04 2009
@@ -16,8 +16,10 @@
 # Released files are placed in this directory first, and from there published to various servers.
 file 'published' do |task, args|
   mkpath task.name
-  puts "Populating published directory from #{args.staging} ..."
-  sh 'rsync', '--progress', '--recursive', "#{args.staging}/", 'published'
+  puts "Populating _release directory from #{args.staging}/dist ..."
+  sh 'rsync', '--progress', '--recursive', "#{args.staging}/dist", '_release'
+  puts "Populating _site directory from #{args.staging}/site ..."
+  sh 'rsync', '--progress', '--recursive', "#{args.staging}/site", '_site'
   puts 'Done'
 end
 

Modified: buildr/trunk/rakelib/rspec.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/rspec.rake?rev=744049&r1=744048&r2=744049&view=diff
==============================================================================
--- buildr/trunk/rakelib/rspec.rake (original)
+++ buildr/trunk/rakelib/rspec.rake Fri Feb 13 09:16:04 2009
@@ -29,7 +29,6 @@
     task.spec_opts = %w{--format specdoc --format failing_examples:failed --format html:_reports/specs.html --loadby mtime --backtrace}    
     task.spec_opts << '--colour' if $stdout.isatty
   end
-  file '_reports/specs.html'=>'spec'
 
   desc 'Run all failed examples from previous run'
   Spec::Rake::SpecTask.new('failed') do |task|
@@ -48,7 +47,6 @@
     task.rcov_dir = '_reports/coverage'
     task.rcov_opts << '--exclude / --include-file ^lib --text-summary'
   end
-  file '_reports/coverage'=>'coverage'
 
   # Useful for testing with JRuby when using Ruby and vice versa.
   namespace 'spec' do

Modified: buildr/trunk/rakelib/stage.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/stage.rake?rev=744049&r1=744048&r2=744049&view=diff
==============================================================================
--- buildr/trunk/rakelib/stage.rake (original)
+++ buildr/trunk/rakelib/stage.rake Fri Feb 13 09:16:04 2009
@@ -15,10 +15,10 @@
 
 
 # Staged files are copied to this directory first, and from there uploaded to the staging server.
-directory 'staged'
+directory '_staged'
 
 task 'clobber' do
-  rm_rf 'staged'
+  rm_rf '_staged'
 end
 
 namespace 'stage' do
@@ -30,13 +30,13 @@
   # stage:prepare prepares all the files necessary for making a successful release:
   # binary and source packages, documentation, Web site, change file, checksums, etc.
   # This task depends on stage:check, and also performs its own verification of the
-  # produced artifacts.  Staged files are placed in the staged directory.
-  task 'prepare'=>'staged'
+  # produced artifacts.  Staged files are placed in the _staged directory.
+  task 'prepare'=>'_staged'
 
   # stage:upload moves the stage directory to the staging server.
   task 'upload' do |task, args|
-    puts "Uploading staged directory to #{args.staging} ..."
-    sh 'rsync', '--progress', '--recursive', 'staged/', args.staging
+    puts "Uploading _staged directory to #{args.staging} ..."
+    sh 'rsync', '--progress', '--recursive', '_staged/', args.staging + '/dist'
     puts 'Done'
   end