Commit 0dcda02f9ef0949108a6f833272d6e9db95781bc
1 parent
925a08f3
Exists in
master
and in
22 other branches
Reworking the release tarball generation
ActionItem1629
Showing
3 changed files
with
18 additions
and
103 deletions
Show diff stats
Rakefile.pkg
| @@ -1,101 +0,0 @@ | @@ -1,101 +0,0 @@ | ||
| 1 | -require(File.join(File.dirname(__FILE__), 'config', 'boot')) | ||
| 2 | - | ||
| 3 | -require 'rake' | ||
| 4 | -require 'rake/testtask' | ||
| 5 | -require 'rake/rdoctask' | ||
| 6 | -require 'rake/packagetask' | ||
| 7 | -require 'noosfero' | ||
| 8 | - | ||
| 9 | -Rake::PackageTask.new(Noosfero::PROJECT, Noosfero::VERSION) do |p| | ||
| 10 | - p.need_tar_gz = true | ||
| 11 | - | ||
| 12 | - # cleaning temporary files | ||
| 13 | - FileUtils.rm_rf('tmp') | ||
| 14 | - FileUtils.mkdir_p('tmp/cache') | ||
| 15 | - FileUtils.mkdir_p('tmp/sessions') | ||
| 16 | - FileUtils.mkdir_p('tmp/sockets') | ||
| 17 | - | ||
| 18 | - # application files | ||
| 19 | - p.package_files.include('app/**/*.{rb,rhtml,rjs,rxml,erb}') | ||
| 20 | - p.package_files.include('config/**/*.{rb,sqlite3}') | ||
| 21 | - p.package_files.include('config/ferret_server.yml.dist') | ||
| 22 | - p.package_files.include('db/migrate/*.rb') | ||
| 23 | - p.package_files.include('db/schema.rb') | ||
| 24 | - p.package_files.include('doc/README_FOR_APP') | ||
| 25 | - p.package_files.include('lib/**/*.{rake,rb}') | ||
| 26 | - p.package_files.include('Rakefile') | ||
| 27 | - p.package_files.include('Rakefile.pkg') | ||
| 28 | - | ||
| 29 | - # translation files | ||
| 30 | - p.package_files.include('po/*/*.po') | ||
| 31 | - p.package_files.include('po/noosfero.pot') | ||
| 32 | - | ||
| 33 | - # templates | ||
| 34 | - p.package_files.include('public/designs/templates/**/*') | ||
| 35 | - | ||
| 36 | - # icon sets | ||
| 37 | - p.package_files.include('public/designs/icons/tango/**/*') | ||
| 38 | - p.package_files.exclude('public/designs/icons/tango/Tango') | ||
| 39 | - p.package_files.exclude('public/designs/icons/default') | ||
| 40 | - | ||
| 41 | - # themes | ||
| 42 | - p.package_files.include('public/designs/themes/noosfero/**/*') | ||
| 43 | - p.package_files.include('public/designs/themes/base/**/*') | ||
| 44 | - p.package_files.exclude('public/designs/themes/default') | ||
| 45 | - | ||
| 46 | - # static files | ||
| 47 | - p.package_files.include('public/dispatch.*') | ||
| 48 | - p.package_files.include('public/favicon.ico') | ||
| 49 | - p.package_files.include('public/*.html') | ||
| 50 | - p.package_files.include('public/*.html.erb') | ||
| 51 | - p.package_files.include('public/images/**/*') | ||
| 52 | - p.package_files.include('public/javascripts/**/*') | ||
| 53 | - p.package_files.include('public/robots.txt') | ||
| 54 | - p.package_files.include('public/stylesheets/**/*') | ||
| 55 | - | ||
| 56 | - # top-level docs | ||
| 57 | - p.package_files.include('README') | ||
| 58 | - p.package_files.include('COPYING') | ||
| 59 | - p.package_files.include('COPYRIGHT') | ||
| 60 | - p.package_files.include('INSTALL') | ||
| 61 | - p.package_files.include('HACKING') | ||
| 62 | - | ||
| 63 | - # scripts | ||
| 64 | - p.package_files.include('script/**/*') | ||
| 65 | - | ||
| 66 | - # test files | ||
| 67 | - p.package_files.include('test/**/*.{rb,yml}') | ||
| 68 | - p.package_files.include('test/fixtures/files/*') | ||
| 69 | - p.package_files.include('features/**/*') | ||
| 70 | - p.package_files.include('config/cucumber.yml') | ||
| 71 | - | ||
| 72 | - # empty directories that must exist | ||
| 73 | - p.package_files.include('tmp/cache') | ||
| 74 | - p.package_files.include('tmp/sessions') | ||
| 75 | - p.package_files.include('tmp/sockets') | ||
| 76 | - p.package_files.include('log') | ||
| 77 | - | ||
| 78 | - # symbolic links | ||
| 79 | - p.package_files.include('app/views/profile_design/*') | ||
| 80 | - p.package_files.include('app/views/environment_design/*') | ||
| 81 | - | ||
| 82 | - # util | ||
| 83 | - p.package_files.include('util/**/*') | ||
| 84 | - | ||
| 85 | - # external resources | ||
| 86 | - p.package_files.include('vendor/**/*') | ||
| 87 | - p.package_files.exclude('vendor/rails') | ||
| 88 | - | ||
| 89 | - # online documentation | ||
| 90 | - p.package_files.include('doc/noosfero/**/*') | ||
| 91 | - | ||
| 92 | - # do not install locally generated files | ||
| 93 | - p.package_files.exclude('coverage/**/*') | ||
| 94 | - p.package_files.exclude('public/images/[0-9][0-9][0-9][0-9]/**/*') | ||
| 95 | - | ||
| 96 | -end | ||
| 97 | - | ||
| 98 | -task :default => :package | ||
| 99 | -task :clean => :clobber_package | ||
| 100 | - | ||
| 101 | -# vim: ft=ruby |
| @@ -0,0 +1,17 @@ | @@ -0,0 +1,17 @@ | ||
| 1 | +require 'noosfero' | ||
| 2 | + | ||
| 3 | +desc "Generate source tarball" | ||
| 4 | +task :package do | ||
| 5 | + begin | ||
| 6 | + sh 'test -d .git' | ||
| 7 | + rescue | ||
| 8 | + puts "** The `package` task only works from within #{Noosfero::PROJECT}'s git repository." | ||
| 9 | + fail | ||
| 10 | + end | ||
| 11 | + rm_rf 'pkg' | ||
| 12 | + release = "#{Noosfero::PROJECT}-#{Noosfero::VERSION}" | ||
| 13 | + target = "pkg/#{release}" | ||
| 14 | + mkdir_p target | ||
| 15 | + sh "git archive HEAD | (cd #{target} && tar x)" | ||
| 16 | + sh "cd pkg && tar czf #{release}.tar.gz #{release}" | ||
| 17 | +end |
lib/tasks/release.rake
| @@ -57,8 +57,7 @@ EOF | @@ -57,8 +57,7 @@ EOF | ||
| 57 | end | 57 | end |
| 58 | 58 | ||
| 59 | desc 'prepares a release tarball' | 59 | desc 'prepares a release tarball' |
| 60 | - task :release => [ :check_tag, 'noosfero:doc:translate', 'noosfero:error-pages:translate', :authors, :check_repo ] do | ||
| 61 | - sh 'rake -f Rakefile.pkg' | 60 | + task :release => [ :check_tag, 'noosfero:doc:translate', 'noosfero:error-pages:translate', :authors, :check_repo, :package ] do |
| 62 | sh "git tag #{version}" | 61 | sh "git tag #{version}" |
| 63 | puts "I: please upload the tarball to the website!" | 62 | puts "I: please upload the tarball to the website!" |
| 64 | puts "I: please push the tag for version #{version} that was just created!" | 63 | puts "I: please push the tag for version #{version} that was just created!" |