Method: Gitlab::Client::BuildVariables#create_group_variable

Defined in:
lib/gitlab/client/build_variables.rb

#create_group_variable(group, key, value) ⇒ Gitlab::ObjectifiedHash

Create a build variable for a group.

Examples:

Gitlab.create_group_variable(5, "NEW_VARIABLE", "new value")

Parameters:

  • group (Integer, String)

    The ID or name of a group.

  • key (String)

    The key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9 and _ are allowed

  • value (String)

    The value of a variable

Returns:



99
100
101
# File 'lib/gitlab/client/build_variables.rb', line 99

def create_group_variable(group, key, value)
  post("/groups/#{url_encode group}/variables", body: { key: key, value: value })
end