Skip to content

Commit

Permalink
Merge d57a6c5 into a246d23
Browse files Browse the repository at this point in the history
  • Loading branch information
ajbarry committed Dec 13, 2016
2 parents a246d23 + d57a6c5 commit 3135edb
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 13 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
language: php

branches:
# Only test the master branch and SemVer tags.
# This branch of terminus is maintenance mode and not actively developed
only:
- master
- /^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+.*$/
- 0.13.x

php:
- 5.5
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#Change Log
All notable changes to this project starting with the 0.6.0 release will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org)

## 0.13.6
### Changed
- Users are notified of impending Terminus release via update notification with the following message:
NOTICE:
Terminus version v1.0 and later introduces a new command line and argument structure that is incompatible with any custom scripts that use terminus or older plugins that you may be using.

PLEASE CONSIDER THE IMPACT TO YOUR AUTOMATION SCRIPTS AND PLUGIN DEPENDENCIES BEFORE UPGRADING TO TERMINUS v1.0

Terminus users will benefit from the new simplified and consistent command structure in v1.0 We have prepared an upgrade guide to assist you in learning the differences and improvements:
https://pantheon.io/docs/terminus/commands/compare/

## 0.13.5
- Rerelease of 0.13.4

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Terminus
============

[![Build Status](https://travis-ci.org/pantheon-systems/terminus.svg?branch=master)](https://travis-ci.org/pantheon-systems/terminus) [![Dependency Status](https://gemnasium.com/pantheon-systems/terminus.svg)](https://gemnasium.com/pantheon-systems/terminus)
[![Coverage Status](https://coveralls.io/repos/github/pantheon-systems/terminus/badge.svg?branch=master)](https://coveralls.io/github/pantheon-systems/terminus?branch=master)
[![Build Status](https://travis-ci.org/pantheon-systems/terminus.svg?branch=0.13.x)](https://travis-ci.org/pantheon-systems/terminus) [![Dependency Status](https://gemnasium.com/pantheon-systems/terminus.svg)](https://gemnasium.com/pantheon-systems/terminus)
[![Coverage Status](https://coveralls.io/repos/github/pantheon-systems/terminus/badge.svg?branch=0.13.x)](https://coveralls.io/github/pantheon-systems/terminus?branch=0.13.x)

Terminus is Pantheon's Command Line Interface (CLI), providing equivalent functionality to the Pantheon Web Dashboard and easier scripting.

Expand Down
2 changes: 1 addition & 1 deletion config/constants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
---

# App
TERMINUS_VERSION: '0.13.5'
TERMINUS_VERSION: '0.13.6'

# Connectivity
TERMINUS_HOST: 'terminus.pantheon.io'
Expand Down
29 changes: 24 additions & 5 deletions php/Terminus/Helpers/UpdateHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,25 @@

class UpdateHelper extends TerminusHelper
{
protected $update_notice = <<<EOT
A new Terminus version v{new_version} is available.
You are currently using version v{this_version}.
/**
NOTICE:
Terminus version v1.0 and later introduces a new command line and
argument structure that is incompatible with any custom scripts
that use terminus or older plugins that you may be using.
PLEASE CONSIDER THE IMPACT TO YOUR AUTOMATION SCRIPTS
AND PLUGIN DEPENDENCIES BEFORE UPGRADING TO TERMINUS v1.0
Terminus users will benefit from the new simplified and consistent
command structure in v1.0 We have prepared an upgrade guide to
assist you in learning the differences and improvements:
https://pantheon.io/docs/terminus/commands/compare/
EOT;

/**
* Retrieves current version number from repository and saves it to the cache
*
* @return string The version number
Expand Down Expand Up @@ -43,11 +60,13 @@ public function checkForUpdate()
|| ((int)$cache_data['check_date'] < (int)strtotime('-7 days'))
) {
try {
$current_version = $this->getCurrentVersion();
if (version_compare($current_version, Config::get('version'), '>')) {
$new_version = $this->getCurrentVersion();
$this_version = Config::get('version');
if (version_compare($new_version, $this_version, '>')) {
$this->command->log()->info(
'An update to Terminus is available. Please update to {version}.',
['version' => $current_version]
$this->update_notice,
['new_version' => $new_version,
'this_version' => $this_version]
);
}
} catch (\Exception $e) {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/old/Helpers/UpdateHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Terminus\UnitTests\Helpers;

use Terminus\Commands\ArtCommand;
use Terminus\Caches\FileCache;
use Terminus\Commands\ArtCommand;
use Terminus\Helpers\UpdateHelper;
use Terminus\UnitTests\TerminusTest;

Expand Down Expand Up @@ -50,7 +50,7 @@ public function testCheckForUpdate()
$this->update_helper->checkForUpdate();
$file_contents = explode("\n", file_get_contents($log_file));
$this->assertFalse(
strpos(array_pop($file_contents), 'An update to Terminus is available.')
strpos(array_pop($file_contents), 'A new Terminus version')
);
$this->resetOutputDestination($log_file);
}
Expand Down

0 comments on commit 3135edb

Please sign in to comment.