Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (27 sloc) 1.097 kB
desc 'Add a tag in git'
task :tag, :version do |t, args|
tagname = args.version
raise 'Please, specify a tagname' unless tagname
puts "Adding tag #{tagname}..."
system "git tag #{tagname}"
end
desc "Update plugin version info in init.rb"
task :update_version, :version do |t, args|
version = args.version
raise 'Please, specify a version number' unless version
puts "Changing plugin version to #{version}..."
text = File.open(File.join(File.dirname(__FILE__), 'init.rb'), 'r') { |file| file.read }
File.open(File.join(File.dirname(__FILE__), 'init.rb'), 'w') { |file|
file.write(text)
} if text.gsub!(/\bversion\b.*$/, "version '#{version}'")
end
desc 'Release a new version'
task :release, [:version] => :update_version do |t, args|
version = args.version
puts 'Committing...'
system "git commit -m 'release: #{args.version}' init.rb"
Rake::Task[:tag].invoke args.version
puts 'Archiving...'
filename = File.join(File.dirname(__FILE__), "redmine_cas-#{version}.tar.gz")
system "git archive --prefix=redmine_cas/ --format=tar HEAD | gzip > #{filename}"
end
Jump to Line
Something went wrong with that request. Please try again.