Method: Gitlab::Client::Environments#create_environment

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

#create_environment(project, env_name, options = {}) ⇒ Gitlab::ObjectifiedHash

Create an environment.

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • env_name (String)

    Name for the environment

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :external_url (String)

    Optional URL for viewing the deployed project in this environment

Returns:

[View source]

44
45
46
47
# File 'lib/gitlab/client/environments.rb', line 44

def create_environment(project, env_name, options = {})
  body = { name: env_name }.merge(options)
  post("/projects/#{url_encode project}/environments", body: body)
end