diff --git a/lib/releaseme/data/ticket_description.txt.erb b/lib/releaseme/data/ticket_description.txt.erb --- a/lib/releaseme/data/ticket_description.txt.erb +++ b/lib/releaseme/data/ticket_description.txt.erb @@ -1,6 +1,6 @@ -Please add <%= version %> to bugs.kde.org product ___PRODUCT_NAME__ +Please add <%= version %> to bugs.kde.org product <%= bugzilla_project %> -Target: ___SPECIFY_YOUR_TARGET_DIR_HERE_NOW_DO_IT__ +Target: <%= release_path %> SHA-256: diff --git a/lib/releaseme/release.rb b/lib/releaseme/release.rb --- a/lib/releaseme/release.rb +++ b/lib/releaseme/release.rb @@ -47,17 +47,23 @@ attr_reader :source # The archive object which will create the archive attr_reader :archive_ + # The release path + attr_reader :release_path + # The bugzilla project + attr_reader :bugzilla_project # Init # @param project [Project] the Project to release # @param origin [Symbol] the origin to release from :trunk or :stable # @param version [String] the versin to release as - def initialize(project, origin, version) + def initialize(project, origin, version, bugzilla_project, release_path) @project = project @source = Source.new @archive_ = XzArchive.new @origin = origin @version = version + @bugzilla_project = bugzilla_project + @release_path = release_path # FIXME: this possibly should be logic inside Project itself? if project.vcs.is_a? Git @@ -129,7 +135,20 @@ title = "Publish #{tar}" sha256s = [sig, tar].collect { |x| `sha256sum #{x}`.strip } sha1s = [sig, tar].collect { |x| `sha1sum #{x}`.strip } - template = HashTemplate.new(sha256s: sha256s, sha1s: sha1s, version: version) + if @bugzilla_project.nil? || @bugzilla_project.empty? + bugzilla_project = @project.identifier + else + bugzilla_project = @bugzilla_project + end + if @release_path.nil? || @release_path.empty? + release_path = "#{@origin}/#{@project.identifier}/#{@version}" + else + release_path = @release_path + end + template = HashTemplate.new(sha256s: sha256s, sha1s: sha1s, version: version, + project: project, origin: origin, + bugzilla_project: bugzilla_project, + release_path: release_path) template_file = "#{__dir__}/data/ticket_description.txt.erb" description = template.render(template_file) sysadmin_ticket_uri(title: title, description: description) diff --git a/tarme.rb b/tarme.rb --- a/tarme.rb +++ b/tarme.rb @@ -51,6 +51,18 @@ ENV['RELEASEME_DEBUG'] = '1' end + opts.on('--bugzilla-project PROJECT', 'Bugzilla Project.', + ' Project name on bugs.kde.org' \ + ' - if empty, the project name is used') do |v| + options[:bugzilla_project] = v + end + + opts.on('--release-path path', 'Release path.', + ' Path on download.kde.org e.g. stable/alkimia/8.0.3' \ + ' - if empty, // is used') do |v| + options[:release_path] = v + end + opts.separator '' opts.separator 'Manual Project Definition:' @@ -91,7 +103,7 @@ release_data_file = File.open('release_data', 'w') releases = release_projects.collect do |project| project_name = project.identifier - release = ReleaseMe::Release.new(project, options[:origin], options[:version]) + release = ReleaseMe::Release.new(project, options[:origin], options[:version], options[:bugzilla_project], options[:release_path]) # FIXME: ALL gets() need to have appropriate handling and must be able to # throw exceptions or return false when something goes wrong