Skip to content

Commit

Permalink
Merge pull request #1190 from pantheon-systems/remove_set_drush_version
Browse files Browse the repository at this point in the history
[FEAT-219] Remove the ability to set drush version, use pantheon.yml instead
  • Loading branch information
TeslaDethray committed Sep 13, 2016
2 parents d57ad1e + c861da4 commit 0f26f81
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 389 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ All notable changes to this project starting with the 0.6.0 release will be docu
## Changed
- Makes API calls to host 'terminus.pantheon.io' instead of 'dashboard.pantheon.io' (#1180)

## Removed
- The command `site set-drush-version` has been removed. Please set your Drush version in your pantheon.yml file. (See: https://pantheon.io/docs/drush-versions) (#1190)

### [0.12.0] - 2016-08-24
### Added
- Added `choices` property to `InputHelper::siteName` parameter object. (#1152)
Expand Down
12 changes: 0 additions & 12 deletions docs/Models/Environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,18 +293,6 @@

---

### setDrushVersion
##### Description:
Sets the Drush version to the indicated version number

##### Parameters:
[string] $version_number Version of Drush to use

##### Return:
[Workflow]

---

### setHttpsCertificate
##### Description:
Add/replace an HTTPS certificate on the environment
Expand Down
43 changes: 0 additions & 43 deletions php/Terminus/Commands/SiteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -1630,49 +1630,6 @@ public function setConnectionMode($args, $assoc_args) {
return true;
}

/**
* Set the version of Drush to be used on a specific environment or site
*
* [--site=<site>]
* : The name of your site on Pantheon
*
* [--env=<environment>]
* : The Pantheon environment to change the Drush version of.
* Note: Leaving this blank will change the versions on all environments.
*
* [--version=<version>]
* : Drush version to use. Options are 5, 7, and 8.
*
* @subcommand set-drush-version
*/
public function setDrushVersion($args, $assoc_args) {
$sites = new Sites();
$site = $sites->get($this->input()->siteName(['args' => $assoc_args,]));
if (isset($assoc_args['env'])) {
$environments = [$site->environments->get($assoc_args['env']),];
} else {
$environments = $site->environments->all();
}
$version = $this->input()->menu(
[
'args' => $assoc_args,
'choices' => [5, 7, 8,],
'key' => 'version',
'message' => 'Select which Drush version to use',
'required' => true,
'return_value' => true,
]
);
foreach ($environments as $environment) {
$workflow = $environment->setDrushVersion((integer)$version);
$this->log()->info(
"Set {environment}'s Drush version to {version}, converging bindings.'",
['environment' => $environment->id, 'version' => $version,]
);
$workflow->wait();
}
}

/**
* Add/replace an HTTPS certificate for an environment
*
Expand Down
29 changes: 0 additions & 29 deletions php/Terminus/Models/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -664,18 +664,6 @@ public function mergeToDev($options = []) {
return $workflow;
}

/**
* Sets the Drush version to the indicated version number
*
* @param string $version_number Version of Drush to use
* @return Workflow
*/
public function setDrushVersion($version_number) {
$this->updateSetting(['drush_version' => $version_number,]);
$workflow = $this->convergeBindings();
return $workflow;
}

/**
* Add/replace an HTTPS certificate on the environment
*
Expand Down Expand Up @@ -775,21 +763,4 @@ private function getSettings($setting = null) {

}

/**
* Changes the environment's settings
*
* @param array $settings Key/value pairs to set in the environment settings
* @return bool
*/
private function updateSetting(array $settings = []) {
$path = sprintf(
'sites/%s/environments/%s/settings',
$this->site->id,
$this->id
);
$params = ['form_params' => $settings, 'method' => 'put',];
$response = $this->request->request($path, $params);
return (boolean)$response['data'];
}

}
13 changes: 0 additions & 13 deletions tests/features/site_set-drush-version.feature

This file was deleted.

0 comments on commit 0f26f81

Please sign in to comment.