You are here

public function NewRelicRpmCommands::deploy in New Relic 8

Same name and namespace in other branches
  1. 2.x src/Commands/NewRelicRpmCommands.php \Drupal\new_relic_rpm\Commands\NewRelicRpmCommands::deploy()
  2. 2.0.x src/Commands/NewRelicRpmCommands.php \Drupal\new_relic_rpm\Commands\NewRelicRpmCommands::deploy()

Mark a deployment in newrelic.

@command new-relic-rpm:deploy @aliases nrd

@option description A brief description of the deployment. @option user User doing the deploy. @option changelog A list of changes for this deployment.

@usage new-relic-rpm:deploy 1.2.3 Create a deployment with revision 1.2.3. @usage new-relic-rpm:deploy 1.2.3 --description="New release". Create a deployment with revision 1.2.3 and a specific description.

@validate-module-enabled new_relic_rpm

Parameters

string $revision: The revision label.

array $options: The options to pass through to the deplopment.

File

src/Commands/NewRelicRpmCommands.php, line 56

Class

NewRelicRpmCommands
Corporate system drush commands.

Namespace

Drupal\new_relic_rpm\Commands

Code

public function deploy($revision, array $options = [
  'description' => NULL,
  'user' => NULL,
  'changelog' => NULL,
]) {
  $deployment = $this->apiClient
    ->createDeployment($revision, $options['description'], $options['user'], $options['changelog']);
  if ($deployment) {
    $this
      ->output()
      ->writeln('New Relic deployment created successfully.');
  }
  else {
    $this
      ->logger()
      ->error(dt('New Relic deployment failed.'));
  }
}