Class: Gitlab::Release::Manager

Inherits:
ApiClient show all
Defined in:
lib/gitlab/release/manager.rb

Overview

This class contains some tools to finish a release.

Instance Method Summary collapse

Methods inherited from ApiClient

#initialize

Constructor Details

This class inherits a constructor from Gitlab::Release::ApiClient

Instance Method Details

#close_milestones(version_name, options = {}) ⇒ Object

Close all the milestones containing the version name.

Parameters:

  • version_name (String)

    Required. The name of the version. (ex: 1.0)

  • [String (Hash)

    a customizable set of options



30
31
32
33
34
35
36
# File 'lib/gitlab/release/manager.rb', line 30

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

#define_tag(tag_name, changelog, options = {}) ⇒ Object

Create a new tag in the Repo.

Parameters:

  • tag_name (String)

    Required. The name of the tag. (ex: 1.0)

  • changelog (String)

    Optional. The release notes related to the tag.

  • [String (Hash)

    a customizable set of options

  • [String] (Hash)

    a customizable set of options



17
18
19
20
21
22
# File 'lib/gitlab/release/manager.rb', line 17

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