lib/gitlab/release/manager.rb in gitlab-release-tools-0.2.0 vs lib/gitlab/release/manager.rb in gitlab-release-tools-1.0.0

- old
+ new

@@ -1,24 +1,35 @@ require 'gitlab/release/api_client' module Gitlab module Release + ## + # This class contains some tools to finish a release. + # class Manager < ApiClient - # @param [String] tag_name - # @param [String] changelog - # @param [String or Integer] project_id default ENV["CI_PROJECT_ID"] - # @param [String] ref default ENV["CI_COMMIT_SHA"] - def define_tag(tag_name, changelog, params = {}) - project_id = params[:project_id] || ENV["CI_PROJECT_ID"] - ref = params[:ref] || ENV["CI_COMMIT_SHA"] + ## + # Create a new tag in the Repo. + # + # @param [String] tag_name Required. The name of the tag. (ex: 1.0) + # @param [String] changelog Optional. The release notes related to the tag. + # @option [String or Integer] project_id Optional. The id of this project, given from GitLab. Default ENV["CI_PROJECT_ID"] + # @option [String] ref Optional. The commit SHA. Default ENV["CI_COMMIT_SHA"] + # + def define_tag(tag_name, changelog, options = {}) + project_id = options[:project_id] || ENV["CI_PROJECT_ID"] + ref = options[:ref] || ENV["CI_COMMIT_SHA"] @client.create_tag(project_id, tag_name, ref, '', changelog) end - # @param [String] version_name - # @param [String or Integer] project_id default ENV["CI_PROJECT_ID"] - def close_milestones(version_name, params = {}) - project_id = params[:project_id] || ENV["CI_PROJECT_ID"] + ## + # Close all the milestones containing the version name. + # + # @param [String] version_name Required. The name of the version. (ex: 1.0) + # @option [String or Integer] project_id Optional. The id of this project, given from GitLab. Default ENV["CI_PROJECT_ID"] + # + def close_milestones(version_name, options = {}) + project_id = options[:project_id] || ENV["CI_PROJECT_ID"] select_milestones(project_id, version_name).each do |milestone| @client.edit_milestone(project_id, milestone.id, state_event: 'close') end end \ No newline at end of file