You are here

protected function RoboFile::createRelease in Panopoly 7

Uses Mink to create a release on Drupal.org.

Parameters

\Behat\Mink\Session $session: The Mink session.

string $module: The machine-name of the module to create the release for.

string $version: The version.

string $release_notes: The text content of the release notes (from `drush rn`).

Throws

\Behat\Mink\Exception\ElementNotFoundException

1 call to RoboFile::createRelease()
RoboFile::releasePublish in ./RoboFile.php
Release Stage 3: Publishes new releases on Drupal.org.

File

./RoboFile.php, line 884

Class

RoboFile
This is project's console commands configuration for Robo task runner.

Code

protected function createRelease(\Behat\Mink\Session $session, $module, $version, $release_notes) {
  $session
    ->visit("https://www.drupal.org/project/{$module}");
  $session
    ->getPage()
    ->clickLink('Add new release');
  try {
    $this
      ->submitForm($session
      ->getPage(), 'project-release-node-form', [
      'versioncontrol_release_label_id' => $version,
    ], 'edit-preview--2');
  } catch (\Exception $e) {
    $this
      ->say("Unable to make release {$module} {$version} - skipping for now (but could be a problem)");
    return;
  }
  $this
    ->submitForm($session
    ->getPage(), 'project-release-node-form', [
    'body[und][0][value]' => $release_notes,
  ], 'edit-submit');
  $this
    ->say("{$module} released - see: " . $session
    ->getCurrentUrl());
}