Hello community,
here is the log from the commit of package platformsh-cli for openSUSE:Factory checked in at 2018-03-02 21:12:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/platformsh-cli (Old)
and /work/SRC/openSUSE:Factory/.platformsh-cli.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "platformsh-cli"
Fri Mar 2 21:12:26 2018 rev:38 rq:581863 version:3.30.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/platformsh-cli/platformsh-cli.changes 2018-02-21 14:13:15.762319076 +0100
+++ /work/SRC/openSUSE:Factory/.platformsh-cli.new/platformsh-cli.changes 2018-03-02 21:12:28.371290861 +0100
@@ -1,0 +2,17 @@
+Fri Mar 02 01:34:38 UTC 2018 - jimmy@boombatower.com
+
+- Update to version 3.30.0:
+ * Release v3.30.0
+ * [self:release] Support editing the changelog [skip changelog]
+ * Format activity descriptions
+ * Print questions even when non-interactive
+ * Add --wait option and shouldWait() cron/hook detection
+ * Update redeploy warning
+ * Add redeploy command
+ * [self:install] Ensure directory exists when creating shell-config.rc
+ * Ensure GitLab/GitHub hooks have the right events (#687)
+ * [activity:get] do not require an environment with --all and a partial ID
+ * [login] Mention --force option
+ * Fix release SHA-256 hash
+
+-------------------------------------------------------------------
Old:
----
platformsh-cli-3.29.2.tar.xz
New:
----
platformsh-cli-3.30.0.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ platformsh-cli.spec ++++++
--- /var/tmp/diff_new_pack.nfvHrL/_old 2018-03-02 21:12:29.263258785 +0100
+++ /var/tmp/diff_new_pack.nfvHrL/_new 2018-03-02 21:12:29.263258785 +0100
@@ -17,7 +17,7 @@
Name: platformsh-cli
-Version: 3.29.2
+Version: 3.30.0
Release: 0
Summary: Tool for managing Platform.sh services from the command line
# See licenses.txt for dependency licenses.
++++++ _service ++++++
--- /var/tmp/diff_new_pack.nfvHrL/_old 2018-03-02 21:12:29.299257492 +0100
+++ /var/tmp/diff_new_pack.nfvHrL/_new 2018-03-02 21:12:29.303257348 +0100
@@ -2,7 +2,7 @@
<service name="tar_scm" mode="disabled">
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">v(.*)</param>
- <param name="revision">refs/tags/v3.29.2</param>
+ <param name="revision">refs/tags/v3.30.0</param>
<param name="url">git://github.com/platformsh/platformsh-cli.git</param>
<param name="scm">git</param>
<param name="changesgenerate">enable</param>
++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.nfvHrL/_old 2018-03-02 21:12:29.319256772 +0100
+++ /var/tmp/diff_new_pack.nfvHrL/_new 2018-03-02 21:12:29.319256772 +0100
@@ -1,6 +1,6 @@
<servicedata>
<service name="tar_scm">
<param name="url">git://github.com/platformsh/platformsh-cli.git</param>
- <param name="changesrevision">c78d88937a158468e41cd0c8d5038305c93e596e</param>
+ <param name="changesrevision">5090df77d2e6441e25c5dc01c37f323e0f5f5dc7</param>
</service>
</servicedata>
++++++ licenses.txt ++++++
--- /var/tmp/diff_new_pack.nfvHrL/_old 2018-03-02 21:12:29.359255334 +0100
+++ /var/tmp/diff_new_pack.nfvHrL/_new 2018-03-02 21:12:29.359255334 +0100
@@ -17,7 +17,7 @@
padraic/humbug_get_contents 1.1.2 BSD-3-Clause
padraic/phar-updater v1.0.5 BSD-3-Clause
paragonie/random_compat v2.0.11 MIT
-platformsh/client v0.15.0 MIT
+platformsh/client v0.16.2 MIT
platformsh/console-form v0.0.16 MIT
psr/container 1.0.0 MIT
psr/log 1.0.2 MIT
++++++ platformsh-cli-3.29.2.tar.xz -> platformsh-cli-3.30.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/composer.json new/platformsh-cli-3.30.0/composer.json
--- old/platformsh-cli-3.29.2/composer.json 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/composer.json 2018-03-01 12:53:28.000000000 +0100
@@ -8,7 +8,7 @@
"guzzlehttp/guzzle": "^5.3",
"guzzlehttp/ringphp": "^1.1",
"platformsh/console-form": ">=0.0.16 <2.0",
- "platformsh/client": ">=0.15.0 <2.0",
+ "platformsh/client": ">=0.16.2 <2.0",
"symfony/console": "^3.0 !=3.2.5 !=3.2.6",
"symfony/yaml": "^3.0 || ^2.6",
"symfony/finder": "^3.0",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/composer.lock new/platformsh-cli-3.30.0/composer.lock
--- old/platformsh-cli-3.29.2/composer.lock 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/composer.lock 2018-03-01 12:53:28.000000000 +0100
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "61139468c3903d4897f8fcfece451e34",
+ "content-hash": "3ec46d331a98339b614a5b1d879727fc",
"packages": [
{
"name": "cocur/slugify",
@@ -711,16 +711,16 @@
},
{
"name": "platformsh/client",
- "version": "v0.15.0",
+ "version": "v0.16.2",
"source": {
"type": "git",
"url": "https://github.com/platformsh/platformsh-client-php.git",
- "reference": "1ab0bd8d229dda78b4a545379fd107de4ead872c"
+ "reference": "d148ca8d4c3239ada8441515a4d8a02067037c96"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/platformsh/platformsh-client-php/zipball/1ab0bd...",
- "reference": "1ab0bd8d229dda78b4a545379fd107de4ead872c",
+ "url": "https://api.github.com/repos/platformsh/platformsh-client-php/zipball/d148ca...",
+ "reference": "d148ca8d4c3239ada8441515a4d8a02067037c96",
"shasum": ""
},
"require": {
@@ -756,7 +756,7 @@
}
],
"description": "Platform.sh API client",
- "time": "2018-02-12T10:31:29+00:00"
+ "time": "2018-03-01T00:18:35+00:00"
},
{
"name": "platformsh/console-form",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/config.yaml new/platformsh-cli-3.30.0/config.yaml
--- old/platformsh-cli-3.29.2/config.yaml 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/config.yaml 2018-03-01 12:53:28.000000000 +0100
@@ -1,7 +1,7 @@
# Metadata about the CLI application itself.
application:
name: 'Platform.sh CLI'
- version: '3.29.2'
+ version: '3.30.0'
executable: 'platform'
package_name: 'platformsh/cli'
installer_url: 'https://platform.sh/cli/installer'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/dist/manifest.json new/platformsh-cli-3.30.0/dist/manifest.json
--- old/platformsh-cli-3.29.2/dist/manifest.json 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/dist/manifest.json 2018-03-01 12:53:28.000000000 +0100
@@ -1,10 +1,10 @@
[
{
"name": "platform.phar",
- "sha1": "9bac0042061ac37dba58fdf727ba9e63026bc134",
- "sha256": "b45c9bdeacd6aac78da9e16c3c564db64100374681ed193bad70a2cf3f9ff09f",
- "url": "https://github.com/platformsh/platformsh-cli/releases/download/v3.29.2/platf...",
- "version": "3.29.2",
+ "sha1": "07479a9542234c5231787fe9694ba0e9f27dc342",
+ "sha256": "559d1d9c8ca7d7364e5d77858d43e401aae2a31b1e2c4ebaee96ed3a66c6f998",
+ "url": "https://github.com/platformsh/platformsh-cli/releases/download/v3.30.0/platf...",
+ "version": "3.30.0",
"php": {
"min": "5.5.9"
},
@@ -107,6 +107,11 @@
"notes": "* [user:add] Improve `user:add` command to allow setting roles on all environments (aliased to `user:update`)\n* [user:get] Add `user:get` command (aliased to and deprecating `user:role`)\n* [db:dump] Remove --no-autocommit and simplify mysqldump args (#683)\n* Expand redeploy warning to recommend `vset`\n* [activity:get] Check for empty started_at when calculating duration\n* [redis] Recommend \"redis info\" command",
"show from": "3.28.0",
"hide from": "3.29.0"
+ },
+ {
+ "notes": "* Add `redeploy` command (available on projects with newer API versions).\n* [activity:list] Format activity descriptions where possible.\n* Print question text even when in automatic non-interactive mode.\n* Add --wait option to all commands, and emit a warning if nothing is specified\n when running inside a Platform.sh build/cron/deploy hook.\n* [integration:add] [integration:update] Ensure GitLab/GitHub hooks have the\n right events selected, and update them if not.\n* [self:install] Ensure directory exists when creating shell-config.rc\n* [activity:get] do not require an environment with --all and a partial ID\n* [login] Mention --force option, if running when already logged in.",
+ "show from": "3.29.0",
+ "hide from": "3.30.0"
}
]
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Application.php new/platformsh-cli-3.30.0/src/Application.php
--- old/platformsh-cli-3.29.2/src/Application.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Application.php 2018-03-01 12:53:28.000000000 +0100
@@ -123,6 +123,7 @@
$commands[] = new Command\Environment\EnvironmentInitCommand();
$commands[] = new Command\Environment\EnvironmentMergeCommand();
$commands[] = new Command\Environment\EnvironmentPushCommand();
+ $commands[] = new Command\Environment\EnvironmentRedeployCommand();
$commands[] = new Command\Environment\EnvironmentRelationshipsCommand();
$commands[] = new Command\Environment\EnvironmentSshCommand();
$commands[] = new Command\Environment\EnvironmentSynchronizeCommand();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Activity/ActivityGetCommand.php new/platformsh-cli-3.30.0/src/Command/Activity/ActivityGetCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Activity/ActivityGetCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Activity/ActivityGetCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -43,9 +43,7 @@
$activity = $this->getSelectedProject()
->getActivity($id);
if (!$activity) {
- $activities = $this->getSelectedEnvironment()
- ->getActivities(0, $input->getOption('type'));
- $activity = $this->api()->matchPartialId($id, $activities, 'Activity');
+ $activity = $this->api()->matchPartialId($id, $this->getActivities($input), 'Activity');
if (!$activity) {
$this->stdErr->writeln("Activity not found: <error>$id</error>");
@@ -53,13 +51,7 @@
}
}
} else {
- if ($this->hasSelectedEnvironment() && !$input->getOption('all')) {
- $activities = $this->getSelectedEnvironment()
- ->getActivities(1, $input->getOption('type'));
- } else {
- $activities = $this->getSelectedProject()
- ->getActivities(1, $input->getOption('type'));
- }
+ $activities = $this->getActivities($input, 1);
/** @var Activity $activity */
$activity = reset($activities);
if (!$activity) {
@@ -76,10 +68,7 @@
$properties = $activity->getProperties();
- // Add the activity "description" as a property.
- if (!isset($properties['description'])) {
- $properties['description'] = $activity->getDescription();
- }
+ $properties['description'] = $activity->getDescription(false);
// Calculate the duration of the activity.
if (!isset($properties['duration'])) {
@@ -128,4 +117,23 @@
return 0;
}
+
+ /**
+ * Get activities on the project or environment.
+ *
+ * @param \Symfony\Component\Console\Input\InputInterface $input
+ * @param int $limit
+ *
+ * @return \Platformsh\Client\Model\Activity[]
+ */
+ private function getActivities(InputInterface $input, $limit = 0)
+ {
+ if ($this->hasSelectedEnvironment() && !$input->getOption('all')) {
+ return $this->getSelectedEnvironment()
+ ->getActivities($limit, $input->getOption('type'));
+ }
+
+ return $this->getSelectedProject()
+ ->getActivities($limit, $input->getOption('type'));
+ }
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Activity/ActivityListCommand.php new/platformsh-cli-3.30.0/src/Command/Activity/ActivityListCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Activity/ActivityListCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Activity/ActivityListCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -97,7 +97,7 @@
$row = [
new AdaptiveTableCell($activity->id, ['wrap' => false]),
$formatter->format($activity['created_at'], 'created_at'),
- $activity->getDescription(),
+ ActivityMonitor::getFormattedDescription($activity),
$activity->getCompletionPercent() . '%',
ActivityMonitor::formatState($activity->state),
ActivityMonitor::formatResult($activity->result, !$table->formatIsMachineReadable()),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Activity/ActivityLogCommand.php new/platformsh-cli-3.30.0/src/Command/Activity/ActivityLogCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Activity/ActivityLogCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Activity/ActivityLogCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -77,7 +77,7 @@
$this->stdErr->writeln([
sprintf('<info>Activity ID: </info>%s', $activity->id),
- sprintf('<info>Description: </info>%s', $activity->getDescription()),
+ sprintf('<info>Description: </info>%s', ActivityMonitor::getFormattedDescription($activity)),
sprintf('<info>Created: </info>%s', $formatter->format($activity->created_at, 'created_at')),
sprintf('<info>State: </info>%s', ActivityMonitor::formatState($activity->state)),
'<info>Log: </info>',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Auth/BrowserLoginCommand.php new/platformsh-cli-3.30.0/src/Command/Auth/BrowserLoginCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Auth/BrowserLoginCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Auth/BrowserLoginCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -54,6 +54,8 @@
$connector = $this->api()->getClient(false)->getConnector();
if (!$input->getOption('force') && $connector->isLoggedIn()) {
$this->stdErr->writeln('You are already logged in.');
+ // USE THE FORCE
+ $this->stdErr->writeln('Use the <comment>--force</comment> (<comment>-f</comment>) option to log in again.');
return 0;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Certificate/CertificateAddCommand.php new/platformsh-cli-3.30.0/src/Command/Certificate/CertificateAddCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Certificate/CertificateAddCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Certificate/CertificateAddCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -19,7 +19,7 @@
->addOption('key', null, InputOption::VALUE_REQUIRED, 'The path to the certificate private key file')
->addOption('chain', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'The path to the certificate chain file');
$this->addProjectOption();
- $this->addNoWaitOption();
+ $this->addWaitOptions();
}
protected function execute(InputInterface $input, OutputInterface $output)
@@ -39,7 +39,7 @@
$result = $project->addCertificate($options['certificate'], $options['key'], $options['chain']);
- if (!$input->getOption('no-wait')) {
+ if ($this->shouldWait($input)) {
/** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
$activityMonitor = $this->getService('activity_monitor');
$activityMonitor->waitMultiple($result->getActivities(), $project);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Certificate/CertificateDeleteCommand.php new/platformsh-cli-3.30.0/src/Command/Certificate/CertificateDeleteCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Certificate/CertificateDeleteCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Certificate/CertificateDeleteCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -19,7 +19,7 @@
->setDescription('Delete a certificate from the project')
->addArgument('id', InputArgument::REQUIRED, 'The certificate ID (or the start of it)');
$this->addProjectOption();
- $this->addNoWaitOption();
+ $this->addWaitOptions();
}
/**
@@ -61,7 +61,7 @@
$this->stdErr->writeln(sprintf('The certificate <info>%s</info> has been deleted.', $certificate->id));
- if (!$input->getOption('no-wait')) {
+ if ($this->shouldWait($input)) {
/** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
$activityMonitor = $this->getService('activity_monitor');
$activityMonitor->waitMultiple($result->getActivities(), $project);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/CommandBase.php new/platformsh-cli-3.30.0/src/Command/CommandBase.php
--- old/platformsh-cli-3.29.2/src/Command/CommandBase.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/CommandBase.php 2018-03-01 12:53:28.000000000 +0100
@@ -557,14 +557,8 @@
$this->stdErr->writeln([
'',
'<comment>The remote environment(s) must be redeployed for the change to take effect.</comment>',
- "Use 'git push' with new commit(s) to trigger a redeploy.",
+ 'To redeploy an environment, run: <info>' . $this->config()->get('application.executable') . ' redeploy</info>',
]);
- if (strpos($this->getName(), 'variable:') !== 0) {
- $this->stdErr->writeln([
- 'Alternatively, add or change an environment variable, e.g.',
- ' <comment>' . $this->config()->get('application.executable') . ' vset _redeploy "$(date)"</comment>'
- ]);
- }
}
/**
@@ -603,16 +597,61 @@
}
/**
- * Add the --no-wait option.
+ * Add both the --no-wait and --wait options.
+ */
+ protected function addWaitOptions()
+ {
+ $this->addOption('no-wait', 'W', InputOption::VALUE_NONE, 'Do not wait for the operation to complete');
+ if ($this->detectRunningInHook()) {
+ $this->addOption('wait', null, InputOption::VALUE_NONE, 'Wait for the operation to complete');
+ } else {
+ $this->addOption('wait', null, InputOption::VALUE_NONE, 'Wait for the operation to complete (default)');
+ }
+ }
+
+ /**
+ * Returns whether we should wait for an operation to complete.
*
- * @param string $description
+ * @param \Symfony\Component\Console\Input\InputInterface $input
*
- * @return CommandBase
+ * @return bool
*/
- protected function addNoWaitOption($description = 'Do not wait for the operation to complete')
+ protected function shouldWait(InputInterface $input)
{
- /** @noinspection PhpIncompatibleReturnTypeInspection */
- return $this->addOption('no-wait', 'W', InputOption::VALUE_NONE, $description);
+ if ($input->hasOption('no-wait') && $input->getOption('no-wait')) {
+ return false;
+ }
+ if ($input->hasOption('wait') && $input->getOption('wait')) {
+ return true;
+ }
+ if ($this->detectRunningInHook()) {
+ $serviceName = $this->config()->get('service.name');
+ $message = "\n<comment>Warning:</comment> $serviceName hook environment detected: assuming <comment>--no-wait</comment> by default."
+ . "\nTo avoid ambiguity, please specify either --no-wait or --wait."
+ . "\n";
+ $this->stdErr->writeln($message);
+
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Detects a Platform.sh non-terminal Dash environment; i.e. a hook.
+ *
+ * @return bool
+ */
+ protected function detectRunningInHook()
+ {
+ $envPrefix = $this->config()->get('service.env_prefix');
+ if (getenv($envPrefix . 'PROJECT')
+ && basename(getenv('SHELL')) === 'dash'
+ && !$this->isTerminal(STDIN)) {
+ return true;
+ }
+
+ return false;
}
/**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Domain/DomainAddCommand.php new/platformsh-cli-3.30.0/src/Command/Domain/DomainAddCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Domain/DomainAddCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Domain/DomainAddCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -17,7 +17,7 @@
->setName('domain:add')
->setDescription('Add a new domain to the project');
$this->addDomainOptions();
- $this->addProjectOption()->addNoWaitOption();
+ $this->addProjectOption()->addWaitOptions();
$this->addExample('Add the domain example.com', 'example.com');
$this->addExample(
'Add the domain secure.example.com with SSL enabled',
@@ -54,7 +54,7 @@
return 1;
}
- if (!$input->getOption('no-wait')) {
+ if ($this->shouldWait($input)) {
/** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
$activityMonitor = $this->getService('activity_monitor');
$activityMonitor->waitMultiple($result->getActivities(), $project);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Domain/DomainDeleteCommand.php new/platformsh-cli-3.30.0/src/Command/Domain/DomainDeleteCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Domain/DomainDeleteCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Domain/DomainDeleteCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -17,7 +17,7 @@
->setName('domain:delete')
->setDescription('Delete a domain from the project')
->addArgument('name', InputArgument::REQUIRED, 'The domain name');
- $this->addProjectOption()->addNoWaitOption();
+ $this->addProjectOption()->addWaitOptions();
$this->addExample('Delete the domain example.com', 'example.com');
}
@@ -48,7 +48,7 @@
$this->stdErr->writeln("The domain <info>$name</info> has been deleted.");
- if (!$input->getOption('no-wait')) {
+ if ($this->shouldWait($input)) {
/** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
$activityMonitor = $this->getService('activity_monitor');
$activityMonitor->waitMultiple($result->getActivities(), $project);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Domain/DomainUpdateCommand.php new/platformsh-cli-3.30.0/src/Command/Domain/DomainUpdateCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Domain/DomainUpdateCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Domain/DomainUpdateCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -16,7 +16,7 @@
->setName('domain:update')
->setDescription('Update a domain');
$this->addDomainOptions();
- $this->addProjectOption()->addNoWaitOption();
+ $this->addProjectOption()->addWaitOptions();
$this->addExample(
'Update the certificate for the domain example.com',
'example.com --cert secure-example-com.crt --key secure-example-com.key'
@@ -60,7 +60,7 @@
$result = $domain->update(['ssl' => $this->sslOptions]);
- if (!$input->getOption('no-wait')) {
+ if ($this->shouldWait($input)) {
/** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
$activityMonitor = $this->getService('activity_monitor');
$activityMonitor->waitMultiple($result->getActivities(), $project);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentActivateCommand.php new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentActivateCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentActivateCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentActivateCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -20,7 +20,7 @@
->addOption('parent', null, InputOption::VALUE_REQUIRED, 'Set a new environment parent before activating');
$this->addProjectOption()
->addEnvironmentOption()
- ->addNoWaitOption();
+ ->addWaitOptions();
$this->addExample('Activate the environments "develop" and "stage"', 'develop stage');
}
@@ -112,7 +112,7 @@
$success = $processed >= $count;
if ($processed) {
- if (!$input->getOption('no-wait')) {
+ if ($this->shouldWait($input)) {
/** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
$activityMonitor = $this->getService('activity_monitor');
$result = $activityMonitor->waitMultiple($activities, $this->getSelectedProject());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentBranchCommand.php new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentBranchCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentBranchCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentBranchCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -34,7 +34,7 @@
);
$this->addProjectOption()
->addEnvironmentOption()
- ->addNoWaitOption("Do not wait for the environment to be branched");
+ ->addWaitOptions();
Ssh::configureInput($this->getDefinition());
$this->addExample('Create a new branch "sprint-2", based on "develop"', 'sprint-2 develop');
}
@@ -153,7 +153,7 @@
}
$remoteSuccess = true;
- if (!$input->getOption('no-wait')) {
+ if ($this->shouldWait($input)) {
/** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
$activityMonitor = $this->getService('activity_monitor');
$remoteSuccess = $activityMonitor->waitAndLog(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentDeleteCommand.php new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentDeleteCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentDeleteCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentDeleteCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -25,7 +25,7 @@
->addOption('exclude', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Environments not to delete');
$this->addProjectOption()
->addEnvironmentOption()
- ->addNoWaitOption();
+ ->addWaitOptions();
$this->addExample('Delete the environments "test" and "example-1"', 'test example-1');
$this->addExample('Delete all inactive environments', '--inactive');
$this->addExample('Delete all environments merged with "master"', '--merged master');
@@ -201,7 +201,7 @@
if ($questionHelper->confirm("Are you sure you want to delete the environment <comment>$environmentId</comment>?")) {
$deactivate[$environmentId] = $environment;
if (!$input->getOption('no-delete-branch')
- && !$input->getOption('no-wait')
+ && $this->shouldWait($input)
&& ($input->getOption('delete-branch')
|| (
$input->isInteractive()
@@ -235,7 +235,7 @@
}
}
- if (!$input->getOption('no-wait')) {
+ if ($this->shouldWait($input)) {
/** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
$activityMonitor = $this->getService('activity_monitor');
if (!$activityMonitor->waitMultiple($deactivateActivities, $this->getSelectedProject())) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentHttpAccessCommand.php new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentHttpAccessCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentHttpAccessCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentHttpAccessCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -37,7 +37,7 @@
);
$this->addProjectOption()
->addEnvironmentOption()
- ->addNoWaitOption();
+ ->addWaitOptions();
$this->addExample('Require a username and password', '--auth myname:mypassword');
$this->addExample('Restrict access to only one IP address', '--access deny:any --access allow:69.208.1.192');
$this->addExample('Remove the password requirement, keeping IP restrictions', '--auth 0');
@@ -197,7 +197,7 @@
$success = true;
if (!$result->countActivities()) {
$this->redeployWarning();
- } elseif (!$input->getOption('no-wait')) {
+ } elseif ($this->shouldWait($input)) {
/** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
$activityMonitor = $this->getService('activity_monitor');
$success = $activityMonitor->waitMultiple($result->getActivities(), $this->getSelectedProject());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentInfoCommand.php new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentInfoCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentInfoCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentInfoCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -31,7 +31,7 @@
Table::configureInput($this->getDefinition());
$this->addProjectOption()
->addEnvironmentOption()
- ->addNoWaitOption();
+ ->addWaitOptions();
$this->addExample('Read all environment properties')
->addExample("Show the environment's status", 'status')
->addExample('Show the date the environment was created', 'created_at')
@@ -60,7 +60,7 @@
$value = $input->getArgument('value');
if ($value !== null) {
- return $this->setProperty($property, $value, $environment, $input->getOption('no-wait'));
+ return $this->setProperty($property, $value, $environment, !$this->shouldWait($input));
}
switch ($property) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentInitCommand.php new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentInitCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentInitCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentInitCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -23,7 +23,7 @@
->addOption('profile', null, InputOption::VALUE_REQUIRED, 'The name of the profile');
$this->addProjectOption()
->addEnvironmentOption()
- ->addNoWaitOption();
+ ->addWaitOptions();
}
protected function execute(InputInterface $input, OutputInterface $output)
@@ -58,7 +58,7 @@
$this->api()->clearEnvironmentsCache($environment->project);
- if (!$input->getOption('no-wait')) {
+ if ($this->shouldWait($input)) {
/** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
$activityMonitor = $this->getService('activity_monitor');
$activityMonitor->waitAndLog($activity);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentMergeCommand.php new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentMergeCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentMergeCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentMergeCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -18,7 +18,7 @@
->addArgument('environment', InputArgument::OPTIONAL, 'The environment to merge');
$this->addProjectOption()
->addEnvironmentOption()
- ->addNoWaitOption();
+ ->addWaitOptions();
$this->addExample('Merge the environment "sprint-2" into its parent', 'sprint-2');
$this->setHelp(
'This command will initiate a Git merge of the specified environment into its parent environment.'
@@ -63,7 +63,7 @@
$this->api()->clearEnvironmentsCache($selectedEnvironment->project);
$activity = $selectedEnvironment->merge();
- if (!$input->getOption('no-wait')) {
+ if ($this->shouldWait($input)) {
/** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
$activityMonitor = $this->getService('activity_monitor');
$success = $activityMonitor->waitAndLog(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentPushCommand.php new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentPushCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentPushCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentPushCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -26,7 +26,7 @@
->addOption('set-upstream', 'u', InputOption::VALUE_NONE, 'Set the target environment as the upstream for the source branch')
->addOption('activate', null, InputOption::VALUE_NONE, 'Activate the environment after pushing')
->addOption('parent', null, InputOption::VALUE_REQUIRED, 'Set a new environment parent (only used with --activate)');
- $this->addNoWaitOption('After pushing, do not wait for build or deploy');
+ $this->addWaitOptions();
$this->addProjectOption()
->addEnvironmentOption();
Ssh::configureInput($this->getDefinition());
@@ -145,7 +145,7 @@
$ssh = $this->getService('ssh');
$extraSshOptions = [];
$env = [];
- if ($input->getOption('no-wait')) {
+ if ($this->shouldWait($input)) {
$extraSshOptions['SendEnv'] = 'PLATFORMSH_PUSH_NO_WAIT';
$env['PLATFORMSH_PUSH_NO_WAIT'] = '1';
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentRedeployCommand.php new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentRedeployCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentRedeployCommand.php 1970-01-01 01:00:00.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentRedeployCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -0,0 +1,47 @@
+setName('environment:redeploy')
+ ->setAliases(['redeploy'])
+ ->setDescription('Redeploy an environment');
+ $this->addProjectOption()
+ ->addEnvironmentOption();
+ $this->addWaitOptions();
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->validateInput($input);
+
+ $environment = $this->getSelectedEnvironment();
+
+ /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */
+ $questionHelper = $this->getService('question_helper');
+ if (!$questionHelper->confirm('Are you sure you want to redeploy the environment <comment>' . $environment->id . '</comment>?')) {
+ return 1;
+ }
+
+ $activity = $environment->redeploy();
+
+ if ($this->shouldWait($input)) {
+ /** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
+ $activityMonitor = $this->getService('activity_monitor');
+ $success = $activityMonitor->waitAndLog($activity);
+ if (!$success) {
+ return 1;
+ }
+ }
+
+ return 0;
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentSynchronizeCommand.php new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentSynchronizeCommand.php
--- old/platformsh-cli-3.29.2/src/Command/Environment/EnvironmentSynchronizeCommand.php 2018-02-20 10:23:04.000000000 +0100
+++ new/platformsh-cli-3.30.0/src/Command/Environment/EnvironmentSynchronizeCommand.php 2018-03-01 12:53:28.000000000 +0100
@@ -20,7 +20,7 @@
->addArgument('synchronize', InputArgument::IS_ARRAY, 'What to synchronize: "code", "data" or both');
$this->addProjectOption()
->addEnvironmentOption()
- ->addNoWaitOption();
+ ->addWaitOptions();
$this->setHelp(<<