]> src.bluestatic.org Git - bugdar.git/blob - docs/package.rb
Fix an issue where after creating a Bugdar user in _fetchBugdarUserFromAuthUser(...
[bugdar.git] / docs / package.rb
1 #!/usr/bin/ruby
2
3 require 'FileUtils'
4
5 puts ""
6 puts "===================================================="
7 puts "Bugdar Release Preparation System $Revision$"
8 puts "===================================================="
9 puts ""
10
11 puts "What is the human-readable version of Bugdar that you are releasing?"
12 versionhr = gets.chomp
13 versionfs = versionhr.gsub(/\./, "-")
14
15 puts ""
16
17 puts "Where should I export Subversion from?"
18 svnpath = gets.chomp
19
20 puts ""
21
22 puts "Preparing the release now..."
23
24 # create the directory
25 puts "... making release directory"
26 pwd = FileUtils.pwd + "/"
27 dirpath = "bugdar-" + versionfs
28 FileUtils.mkdir(dirpath)
29 FileUtils.cd(pwd + dirpath)
30
31 # export subversion
32 puts "... exporting subversion"
33 system "svn export -q --non-interactive " + svnpath + " upload/"
34
35 # remove temp directories
36 puts "... cleaning SVN export"
37 FileUtils.rm_rf("upload/docs/")
38 FileUtils.rm_rf("upload/framework/dev/")
39
40 # move good files up
41 puts "... preparing main files"
42 FileUtils.mv("upload/INSTALLING", ".")
43 FileUtils.mv("upload/UPGRADING", ".")
44 FileUtils.mv("upload/CREDITS", ".")
45 FileUtils.mv("upload/COPYING", ".")
46
47 # tar and zip the files
48 FileUtils.cd("..")
49 system "zip -rq bugdar-" + versionfs + ".zip " + dirpath
50 puts "... creating ZIP file"
51 system "tar czf bugdar-" + versionfs + ".tgz " + dirpath
52 puts "... creating TAR file"
53
54 # cleanup
55 FileUtils.rm_rf(dirpath)
56 puts "Finished!"