Class: Gitlab::Ci::Build::Releaser
- Inherits:
-
Object
- Object
- Gitlab::Ci::Build::Releaser
- Defined in:
- lib/gitlab/ci/build/releaser.rb
Constant Summary collapse
- BASE_COMMAND =
'release-cli create'
- SINGLE_FLAGS =
%i[name description tag_name tag_message ref released_at].freeze
- ARRAY_FLAGS =
%i[milestones].freeze
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config:) ⇒ Releaser
constructor
A new instance of Releaser.
- #script ⇒ Object
Constructor Details
#initialize(config:) ⇒ Releaser
Returns a new instance of Releaser.
13 14 15 |
# File 'lib/gitlab/ci/build/releaser.rb', line 13 def initialize(config:) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
11 12 13 |
# File 'lib/gitlab/ci/build/releaser.rb', line 11 def config @config end |
Instance Method Details
#script ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/gitlab/ci/build/releaser.rb', line 17 def script command = BASE_COMMAND.dup single_flags.each { |k, v| command.concat(" --#{k.to_s.dasherize} \"#{v}\"") } array_commands.each { |k, v| v.each { |elem| command.concat(" --#{k.to_s.singularize.dasherize} \"#{elem}\"") } } asset_links.each { |link| command.concat(" --assets-link #{stringified_json(link)}") } [command.freeze] end |