Giter Site home page Giter Site logo

typhonius / acquia_cli Goto Github PK

View Code? Open in Web Editor NEW
30.0 6.0 19.0 737 KB

Provides a Robo console application to the Acquia CloudAPI for managing deployment tasks and environment configuration.

License: MIT License

PHP 100.00%
acquia symfony console robo phar application cli acquia-cli

acquia_cli's Introduction

Acquia Cli Test Total Downloads Coverage Status

License Latest Stable Version Latest Unstable Version

Acquia Cli

The Acquia Cli tool provides developers, sysops, release managers and website administrators with a simple to use tool for obtaining information and running tasks on the Acquia Cloud.

Acquia Cli is simple to install and aligns to the permissions constructs already built into Acquia. The tool can be used for any task that can be completed using the Acquia web interface, and contains in-built instructions for each task.

If Acquia Cli doesn't have the task built in, simply create a ticket or a pull request for it to be included.

Pre-installation

Generating an API access token

To generate an API access token, login to https://cloud.acquia.com, then visit https://cloud.acquia.com/#/profile/tokens, and click Create Token.

  • Provide a label for the access token, so it can be easily identified. Click Create Token.
  • The token has been generated, copy the api key and api secret to a secure place. Make sure you record it now: you will not be able to retrieve this access token's secret again.

Downloading a version of the application

Select either the packaged application or the source application below before continuing with setup steps.

Installing the packaged application (easiest)

To install the packaged application quickly and easily, the following three steps may be executed.

wget https://github.com/typhonius/acquia_cli/releases/latest/download/acquiacli.phar
mv acquiacli.phar /usr/local/bin/acquiacli
chmod +x /usr/local/bin/acquiacli

Automatic updates

If the packaged application is used, it can be updated simply and easily whenever a new release is out by running the following command from anywhere on the computer:

acquiacli self:update

Installing from source (advanced)

To install from source, clone the repository into a location on your computer with the following commands:

git clone https://github.com/typhonius/acquia_cli.git
cd acquia_cli
composer install

Setup

Choose one of the following methods to finish setting up your AcquiaCli installation.

Automatic setup

Once you have downloaded the application using one of the above steps, run the following commands to enter add your Acquia credentials.

  1. Run acquiacli setup (or ./vendor/bin/acquiacli setup when used as a dependency in another project) which will ask for your credentials and automatically create this file.
  2. Run acquiacli drush:aliases to download your available Drush aliases. Follow the instructions output by the command to install them.

Manual installation/setup

Alternatively, follow the below steps for a manual installation.

  1. Copy the default.acquiacli.yml file to your project root and name it acquiacli.yml.
  2. Add your Acquia key and secret to the acquiacli.yml file.

Environment Variables

Environmment variables can be used to store and provide the API key and secret, removing the need for configuration files. Refer to the values in default.acquiacli.yml for examples of how to configure these environment variables.

  • ACQUIACLI_KEY The environment variable for the API key
  • ACQUIACLI_SECRET The environment variable for the API secret
  • ACQUIACLI_TIMEZONE Use a supported PHP timezone to see times in your locale.
  • ACQUIACLI_FORMAT Use a supported PHP date string to show times in an alternate format.
  • ACQUIACLI_TASKWAIT A number in seconds to wait before hitting the API to check the status of a task.
  • ACQUIACLI_TIMEOUT A number in seconds before a task is considered to have timed out.

If environment variables are to be used, these will need to be placed in the relevant bash file on Linux/Mac e.g. $HOME/.bashrc or $HOME/.bash_profile in the following format.

export ACQUIACLI_KEY=15fd1cde-1e66-b113-8e98-5ff9d444d54f
export ACQUIACLI_SECRET=Sdtg0o83TrZm5gVckpaZynCxpikMqcht9u3fexWIHm7

Windows users will need to add the environment variables within their system settings.

Configuration

The Acquia Cli tool uses cascading configuration on the user's own machine to allow both global and per project credentials and overrides as needed.

Acquia Cli will load configuration in the following order with each step overriding matching array keys in the step prior:

  1. Firstly, default configuration from default.acquiacli.yml in the project root/packaged with the Phar is loaded.
  2. Next, if it exists, global configuration from $HOME/.acquiacli/acquiacli.yml is loaded.
  3. Finally, if it exists, an acquiacli.yml file in the project root will be loaded. (Not applicable if using the Phar)
  4. Environment variables take overall precedence for the key and secret, however other config won't be overridden.

The global and per project files may be deleted (manually) and recreated with acquiacli setup whenever a user wishes to do so.

Options may be manually set within the relevant acquiacli.yml file to change the following parameters under the extraconfig key:

Key Default Description
timezone Australia/Sydney Use a supported PHP timezone to see times in your locale.
format Y-m-d H:i:s Use a supported PHP date string to show times in an alternate format.
taskwait 5 A number in seconds to wait before hitting the API to check the status of a task.
timeout 300 A number in seconds before a task is considered to have timed out.

Usage/Examples

Some of the following commands have aliases for simplicity e.g. environment:info has the alias of e:i.

# Show which applications you have access to.
acquiacli application:list

# Show detailed information about servers in the prod environment (assuming sitename of prod:acquia obtained from site:list command)
acquiacli environment:info prod:myacquiasite prod

# Copy the files and db from alpha to dev in preparation for a deployment
acquiacli deploy:prepare prod:myacquiasite dev alpha

# Copy the files and db from prod to test to prepare for a deployment.
# N.B. if the last argument is omitted in deploy:prepare, prod will be used
acquiacli deploy:prepare prod:myacquiasite test

# Deploy the develop-build branch to the test environment.
acquiacli code:switch prod:myacquiasite test develop-build

# Deploy the release-1.2.3 branch/tag to the production environment without prompting the user to confirm.
acquiacli code:switch prod:myacquiasite prod release-1.2.3 --yes

# Promote the code in preprod to prod.
acquiacli code:deploy prod:myacquiasite preprod prod

# Get a list of organizations you have access to and display organization UUIDs.
acquiacli organization:list

# Add a new team to an organization.
acquiacli team:create 'My Team Name' 'External Contractors'

# Add a new role to an organization (Use permissions:list to get available permissions for the new role).
acquiacli role:add 'My Team Name' 'Contractors' 'move file to non-prod,move file from prod,download db backup non-prod,download logs non-prod,deploy to non-prod'

# Associate a team with an application within the organization (Use organization:teams to get team UUIDs).
acquiacli team:addapp prod:myacquiasite d2693c6e-58e7-47e5-8867-e2db88c71b8c

# Add a user to a team and assign roles (Use role:list to obtain the role UUIDs).
acquiacli team:invite d2693c6e-58e7-47e5-8867-e2db88c71b8c '[email protected]' f0b89594-0fc5-4609-935f-1f18c313c6c7

Additional parameters

The --limit, --sort, and --filter parameters can be added to every single command used with the Acquia Cli tool for providing more relevant information to users who are working on sites.

Limiting

To limit the number of returned entries, use --limit=x with a command.

# Reduce the number of notifications passed back to 10.
acquiacli notification:list myacquiasite --limit=10

Sorting

A comma-delimited string with fields can be used for sorting. The order of the fields is significant. A leading - in the field indicates the field should be sorted in a descending order. Not all fields are sortable.

# Sort all applications first by organization name (alphabetically) and then by label (reverse-alphabetically).
acquiacli application:list --sort='organization_name,-label'

Filtering

The filters query string parameter restricts the data returned from your request. Filtered queries restrict the rows that do (or do not) get included in the result by testing each row in the result against the filters. Not all fields are filterable.

There are eight filter operators that can be used and they must be URL encoded in order to be included. The operators are:

  • Equals: =
  • Does not equal: !=
  • Greater than: >
  • Less than: <
  • Greater than or equal to: >=
  • Less than or equal to: <=
  • Contains substring: =@
  • Does not contain substring: !@

Filters can be combined using OR and AND boolean logic. The OR operator is defined using a comma (,) and the AND operator is defined using a semi-colon (;).

# Show all tasks with a label starting with Database after 1st April 2019 and before 1st Jan 2020.
acquiacli notification:list myacquiasite --filter='label=@Database*;created_at>2019-04-01;created_at<2020-01-01'
# Show all tasks with a label starting with Database OR a label exactly matching 'Code switched'
acquiacli notification:list myacquiasite --filter='label=@Database*,label=Code switched'

See it in action

asciicast

Command Parameters

Application UUID

If a command takes an application UUID as a parameter, it can be provided in one of three ways - see below for a description of hosting realm:

  • The Acquia hosting ID on its own e.g. myacquiasite
  • The full Acquia hosting realm and ID e.g. prod:myacquiasite
  • The application UUID e.g. 8ff6c046-ec64-4ce4-bea6-27845ec18600

Hosting Realms

Acquia uses the concept of a 'realm' to differentiate between customers on the two tiers of hosting offered:

  • prod: The 'prod' realm is exclusively for Acquia Cloud Enterprise (ACE) customers.
  • devcloud: The 'devcloud' realm is exclusively for Acquia Cloud Professional (ACP) customers.

If no hosting realm is provided, prod is used by default. This can be overridden in the command by specifying a realm e.g. --realm=devcloud

Both the UUID and the hosting ID (with realm) for your applications may be discovered by running acquiacli application:list

Other parameters

Environment parameters take the label name of the environment e.g. dev

Organization parameters take the label name of the organization e.g. mycompany

All other parameters are currently provided in the UUID form, including but not limited to:

  • Role ID
  • Team ID

Commands using the following parameters will be automatically converted by the Acquia Cli tool using the SDK. This is achieved in the validateUuidHook method in the AcquiaCommand class using a @hook validate annotation.

  • $uuid is converted to the UUID of the application

Helper functions exist in CloudApi.php to convert user supplied parameters into more useful objects.

  • Environments may be converted into an EnvironmentResponse object by using the getEnvironment method.
  • Organizations may be converted into an OrganizationResponse object by using the getOrganization method.

Usage on Windows

The Phar file has been tested minimally on Windows. It may be executed using PHP from a tool such as Chocolatey. You may run into cURL issues with SSL in some instances. The recommended approach to remediating SSL issues is to follow the basic instructions here. You may need to use alternate paths based on your PHP installation.

acquia_cli's People

Contributors

b-sharpe avatar dependabot-preview[bot] avatar earthday47 avatar keeganstreet avatar typhonius avatar violinist-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

acquia_cli's Issues

Semaphore extension

getting the below error when using this, please let me know how we can address this

+ vendor/bin/acquiacli app:list
PHP Warning:  Declaration of AcquiaCli\Commands\AcquiaCommand::confirm($question) should be compatible with Robo\Tasks::confirm($question, $default = false) in /vendor/typhonius/acquia_cli/src/Commands/AcquiaCommand.php on line 19
PHP Fatal error:  Uncaught Symfony\Component\Lock\Exception\InvalidArgumentException: Semaphore extension (sysvsem) is required in /vendor/symfony/lock/Store/SemaphoreStore.php:41
Stack trace:
#0 /vendor/typhonius/acquia_cli/src/AcquiaCli.php(88): Symfony\Component\Lock\Store\SemaphoreStore->__construct()
#1 /vendor/typhonius/acquia_cli/bin/acquiacli-robo.php(44): AcquiaCli\AcquiaCli->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /vendor/typhonius/acquia_cli/bin/acquiacli(11): require_once('/home/jenkins/w...')
#3 {min}
  ​thrown in /vendor/symfony/lock/Store/SemaphoreStore.php on line 41

CI acquia task number output?

Issue that prompts the request
We use gitlab + kubernetes + acquia_cli to do autodeploys each night. Some nights the builds&deploys fail for various reasons. However the standard output does not indicate which Acquia task is the one that failed. We obviously know the job that failed but not the Acquia Task ID in the standard out. Usually, if there is a failure, we go to the Acquia Admin UI and browse through the task list and look for the failed job. This works fine until the acquia task list is truncated by the interface and we can no longer browse for the task in question.

Our output looks like this:

  Looking up notification                      
 < 1 sec [➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 6 secs [⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 >  Moving DB (WXXXXXXd8) from Sandbox2 to Dev
 11 secs [⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0% Looking up notification                      
 < 1 sec [➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 5 secs [⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 11 secs [⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 16 secs [⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 21 secs [⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 27 secs [⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 32 secs [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 38 secs [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 43 secs [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 49 secs [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 54 secs [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0% [error]  Acquia task failed. 
 command terminated with exit code 1

Proposed Solution
What would be great is to see the task ID that the progress meter is monitoring so we can research them better. So an output like this would be great:

>  Backing up DB (WXXXXXXD8) on Dev
  Looking up notification                      
 < TASKID 993456 1 sec [➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 TASKID 993456 6 secs [⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 >  Moving DB (wXXXXXXXX8) from Sandbox2 to Dev
TASKID 993457 11 secs [⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0% Looking up notification                      
 < TASKID 993457 1 sec [➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 TASKID 993457 5 secs [⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 TASKID 993457 11 secs [⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 TASKID 993457 16 secs [⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%
  Notification in-progress                     
 TASKID 993457 21 secs [⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%

Describe alternatives you've considered
I've only briefly looked through the options to see if one exists for this already. Does it?

Wrong example of deploy:prepare

Describe the bug

Wrong execution when calling acquiacli deploy:prepare.
On the example section on Readme file, it says acquiacli deploy:prepare UUID, environmentFrom, environmentTo

# Copy the files and db from alpha to dev for testing new code
acquiacli deploy:prepare prod:myacquiasite alpha dev

but looking deeply on DeployCommand.php it is public function deployPrepare($uuid, $environmentTo, $environmentFrom = null).

Expected behavior

I believe the expected behavior must be:

# Copy the files and db to dev from alpha for testing new code.
acquiacli deploy:prepare prod:myacquiasite **dev alpha** 

Also, it could be more clear regarding not passing the last argument, which means that it is going to pull the db and files from production.

Additional context
Tested on acquia_cli:2.0.3 tag.

Thanks for this very helpful project.

preprod:prepare throwns an exception

It happens each time when I call

acquiacli preprod:prepare devcloud:<app> test dev

The command continues to execute, but I think it's just not handled exception.

The full log is:

$ acquiacli preprod:prepare devcloud:<app> test dev                                                                                                                                                                                  [11:31:43]
PHP Notice:  Undefined property: stdClass::$insight in /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentResponse.php on line 44
PHP Stack trace:
PHP   1. {main}() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli:0
PHP   2. require_once() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli:11
PHP   3. AcquiaCli\AcquiaCli->run() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli-robo.php:44
PHP   4. Robo\Runner->run() /home/mbaev/.acquia/api-v2-cli/src/AcquiaCli.php:98
PHP   5. Robo\Application->run() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/robo/src/Runner.php:175
PHP   6. Robo\Application->doRun() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:148
PHP   7. Robo\Application->doRunCommand() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:240
PHP   8. Consolidation\AnnotatedCommand\AnnotatedCommand->run() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:956
PHP   9. Consolidation\AnnotatedCommand\AnnotatedCommand->execute() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Command/Command.php:252
PHP  10. Consolidation\AnnotatedCommand\CommandProcessor->process() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:404
PHP  11. Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/CommandProcessor.php:148
PHP  12. Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->validate() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/CommandProcessor.php:167
PHP  13. Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->callValidator() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:27
PHP  14. AcquiaCli\Commands\DeployCommand->validateUuidHook() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:43
PHP  15. AcquiaCli\Commands\DeployCommand->getEnvironmentFromEnvironmentName() /home/mbaev/.acquia/api-v2-cli/src/Commands/AcquiaCommand.php:115
PHP  16. AcquiaCloudApi\CloudApi\Client->environments() /home/mbaev/.acquia/api-v2-cli/src/Commands/AcquiaCommand.php:134
PHP  17. AcquiaCloudApi\Response\EnvironmentsResponse->__construct() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/CloudApi/Client.php:473
PHP  18. array_map() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18
PHP  19. AcquiaCloudApi\Response\EnvironmentsResponse->AcquiaCloudApi\Response\{closure:/home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18-20}() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18
PHP  20. AcquiaCloudApi\Response\EnvironmentResponse->__construct() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:19
PHP Notice:  Undefined property: stdClass::$insight in /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentResponse.php on line 44
PHP Stack trace:
PHP   1. {main}() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli:0
PHP   2. require_once() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli:11
PHP   3. AcquiaCli\AcquiaCli->run() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli-robo.php:44
PHP   4. Robo\Runner->run() /home/mbaev/.acquia/api-v2-cli/src/AcquiaCli.php:98
PHP   5. Robo\Application->run() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/robo/src/Runner.php:175
PHP   6. Robo\Application->doRun() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:148
PHP   7. Robo\Application->doRunCommand() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:240
PHP   8. Consolidation\AnnotatedCommand\AnnotatedCommand->run() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:956
PHP   9. Consolidation\AnnotatedCommand\AnnotatedCommand->execute() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Command/Command.php:252
PHP  10. Consolidation\AnnotatedCommand\CommandProcessor->process() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:404
PHP  11. Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/CommandProcessor.php:148
PHP  12. Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->validate() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/CommandProcessor.php:167
PHP  13. Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->callValidator() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:27
PHP  14. AcquiaCli\Commands\DeployCommand->validateUuidHook() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:43
PHP  15. AcquiaCli\Commands\DeployCommand->getEnvironmentFromEnvironmentName() /home/mbaev/.acquia/api-v2-cli/src/Commands/AcquiaCommand.php:115
PHP  16. AcquiaCloudApi\CloudApi\Client->environments() /home/mbaev/.acquia/api-v2-cli/src/Commands/AcquiaCommand.php:134
PHP  17. AcquiaCloudApi\Response\EnvironmentsResponse->__construct() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/CloudApi/Client.php:473
PHP  18. array_map() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18
PHP  19. AcquiaCloudApi\Response\EnvironmentsResponse->AcquiaCloudApi\Response\{closure:/home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18-20}() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18
PHP  20. AcquiaCloudApi\Response\EnvironmentResponse->__construct() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:19
PHP Notice:  Undefined property: stdClass::$insight in /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentResponse.php on line 44
PHP Stack trace:
PHP   1. {main}() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli:0
PHP   2. require_once() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli:11
PHP   3. AcquiaCli\AcquiaCli->run() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli-robo.php:44
PHP   4. Robo\Runner->run() /home/mbaev/.acquia/api-v2-cli/src/AcquiaCli.php:98
PHP   5. Robo\Application->run() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/robo/src/Runner.php:175
PHP   6. Robo\Application->doRun() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:148
PHP   7. Robo\Application->doRunCommand() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:240
PHP   8. Consolidation\AnnotatedCommand\AnnotatedCommand->run() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:956
PHP   9. Consolidation\AnnotatedCommand\AnnotatedCommand->execute() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Command/Command.php:252
PHP  10. Consolidation\AnnotatedCommand\CommandProcessor->process() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:404
PHP  11. Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/CommandProcessor.php:148
PHP  12. Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->validate() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/CommandProcessor.php:167
PHP  13. Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->callValidator() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:27
PHP  14. AcquiaCli\Commands\DeployCommand->validateUuidHook() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:43
PHP  15. AcquiaCli\Commands\DeployCommand->getEnvironmentFromEnvironmentName() /home/mbaev/.acquia/api-v2-cli/src/Commands/AcquiaCommand.php:115
PHP  16. AcquiaCloudApi\CloudApi\Client->environments() /home/mbaev/.acquia/api-v2-cli/src/Commands/AcquiaCommand.php:134
PHP  17. AcquiaCloudApi\Response\EnvironmentsResponse->__construct() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/CloudApi/Client.php:473
PHP  18. array_map() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18
PHP  19. AcquiaCloudApi\Response\EnvironmentsResponse->AcquiaCloudApi\Response\{closure:/home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18-20}() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18
PHP  20. AcquiaCloudApi\Response\EnvironmentResponse->__construct() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:19
PHP Notice:  Undefined property: stdClass::$insight in /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentResponse.php on line 44
PHP Stack trace:
PHP   1. {main}() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli:0
PHP   2. require_once() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli:11
PHP   3. AcquiaCli\AcquiaCli->run() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli-robo.php:44
PHP   4. Robo\Runner->run() /home/mbaev/.acquia/api-v2-cli/src/AcquiaCli.php:98
PHP   5. Robo\Application->run() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/robo/src/Runner.php:175
PHP   6. Robo\Application->doRun() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:148
PHP   7. Robo\Application->doRunCommand() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:240
PHP   8. Consolidation\AnnotatedCommand\AnnotatedCommand->run() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:956
PHP   9. Consolidation\AnnotatedCommand\AnnotatedCommand->execute() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Command/Command.php:252
PHP  10. Consolidation\AnnotatedCommand\CommandProcessor->process() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:404
PHP  11. Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/CommandProcessor.php:148
PHP  12. Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->validate() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/CommandProcessor.php:167
PHP  13. Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->callValidator() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:27
PHP  14. AcquiaCli\Commands\DeployCommand->validateUuidHook() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:43
PHP  15. AcquiaCli\Commands\DeployCommand->getEnvironmentFromEnvironmentName() /home/mbaev/.acquia/api-v2-cli/src/Commands/AcquiaCommand.php:120
PHP  16. AcquiaCloudApi\CloudApi\Client->environments() /home/mbaev/.acquia/api-v2-cli/src/Commands/AcquiaCommand.php:134
PHP  17. AcquiaCloudApi\Response\EnvironmentsResponse->__construct() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/CloudApi/Client.php:473
PHP  18. array_map() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18
PHP  19. AcquiaCloudApi\Response\EnvironmentsResponse->AcquiaCloudApi\Response\{closure:/home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18-20}() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18
PHP  20. AcquiaCloudApi\Response\EnvironmentResponse->__construct() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:19
PHP Notice:  Undefined property: stdClass::$insight in /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentResponse.php on line 44
PHP Stack trace:
PHP   1. {main}() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli:0
PHP   2. require_once() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli:11
PHP   3. AcquiaCli\AcquiaCli->run() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli-robo.php:44
PHP   4. Robo\Runner->run() /home/mbaev/.acquia/api-v2-cli/src/AcquiaCli.php:98
PHP   5. Robo\Application->run() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/robo/src/Runner.php:175
PHP   6. Robo\Application->doRun() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:148
PHP   7. Robo\Application->doRunCommand() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:240
PHP   8. Consolidation\AnnotatedCommand\AnnotatedCommand->run() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:956
PHP   9. Consolidation\AnnotatedCommand\AnnotatedCommand->execute() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Command/Command.php:252
PHP  10. Consolidation\AnnotatedCommand\CommandProcessor->process() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:404
PHP  11. Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/CommandProcessor.php:148
PHP  12. Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->validate() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/CommandProcessor.php:167
PHP  13. Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->callValidator() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:27
PHP  14. AcquiaCli\Commands\DeployCommand->validateUuidHook() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:43
PHP  15. AcquiaCli\Commands\DeployCommand->getEnvironmentFromEnvironmentName() /home/mbaev/.acquia/api-v2-cli/src/Commands/AcquiaCommand.php:120
PHP  16. AcquiaCloudApi\CloudApi\Client->environments() /home/mbaev/.acquia/api-v2-cli/src/Commands/AcquiaCommand.php:134
PHP  17. AcquiaCloudApi\Response\EnvironmentsResponse->__construct() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/CloudApi/Client.php:473
PHP  18. array_map() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18
PHP  19. AcquiaCloudApi\Response\EnvironmentsResponse->AcquiaCloudApi\Response\{closure:/home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18-20}() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18
PHP  20. AcquiaCloudApi\Response\EnvironmentResponse->__construct() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:19
PHP Notice:  Undefined property: stdClass::$insight in /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentResponse.php on line 44
PHP Stack trace:
PHP   1. {main}() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli:0
PHP   2. require_once() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli:11
PHP   3. AcquiaCli\AcquiaCli->run() /home/mbaev/.acquia/api-v2-cli/bin/acquiacli-robo.php:44
PHP   4. Robo\Runner->run() /home/mbaev/.acquia/api-v2-cli/src/AcquiaCli.php:98
PHP   5. Robo\Application->run() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/robo/src/Runner.php:175
PHP   6. Robo\Application->doRun() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:148
PHP   7. Robo\Application->doRunCommand() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:240
PHP   8. Consolidation\AnnotatedCommand\AnnotatedCommand->run() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Application.php:956
PHP   9. Consolidation\AnnotatedCommand\AnnotatedCommand->execute() /home/mbaev/.acquia/api-v2-cli/vendor/symfony/console/Command/Command.php:252
PHP  10. Consolidation\AnnotatedCommand\CommandProcessor->process() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:404
PHP  11. Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/CommandProcessor.php:148
PHP  12. Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->validate() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/CommandProcessor.php:167
PHP  13. Consolidation\AnnotatedCommand\Hooks\Dispatchers\ValidateHookDispatcher->callValidator() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:27
PHP  14. AcquiaCli\Commands\DeployCommand->validateUuidHook() /home/mbaev/.acquia/api-v2-cli/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ValidateHookDispatcher.php:43
PHP  15. AcquiaCli\Commands\DeployCommand->getEnvironmentFromEnvironmentName() /home/mbaev/.acquia/api-v2-cli/src/Commands/AcquiaCommand.php:120
PHP  16. AcquiaCloudApi\CloudApi\Client->environments() /home/mbaev/.acquia/api-v2-cli/src/Commands/AcquiaCommand.php:134
PHP  17. AcquiaCloudApi\Response\EnvironmentsResponse->__construct() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/CloudApi/Client.php:473
PHP  18. array_map() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18
PHP  19. AcquiaCloudApi\Response\EnvironmentsResponse->AcquiaCloudApi\Response\{closure:/home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18-20}() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:18
PHP  20. AcquiaCloudApi\Response\EnvironmentResponse->__construct() /home/mbaev/.acquia/api-v2-cli/vendor/typhonius/acquia-php-sdk-v2/src/Response/EnvironmentsResponse.php:19

Code commit task is missing

Describe the bug
The task list or notification list does not show any activities related to code commit. (CodeDeployed
CodeSwitched)

To Reproduce
tried using both v1 & v2

./bin/acquiacli task:list $APP
./bin/acquiacli notification:list $APP

Expected behavior
Should display CodeDeployed, CodeSwitched items in the list

Additional context
Not sure whether the Acquia API is not returning these data

Update to use ^3 of consolidation/robo

Currently acquia_cli requires "consolidation/robo": "^2" which works fine with Drush 10 which had a requirement of "consolidation/robo": "^1.4.11 || ^2 || ^3". Since Drush 11 though the requirement is now "consolidation/robo": "^3". This means it is no longer possible to have the latest versions of both acquia_cli and drush in the same project.

Environment Key variables Not working?

Describe the bug
I'm not able to get the environment variable keys to be used. When the keys are specified within the acquiacli.yml file then acquiacli connects to acquia just fine.

To Reproduce
in bash:

vendor/bin/acquiacli application:info XXXXX
export ACQUIACLI_SECRET=ASDFASDFDBASDF
export ACQUIACLI_KEY=ASDFADFASDFASDF

On line two of acquiacli.yml file change key value to be bogus value.
On line three of acquiacli.yml file change secret value to be bogus value.

vendor/bin/acquiacli application:info XXXXXX

The first execution of acquiacli connects and prints info. The second does not. Tried several variations of editing the acquiacli.yml to try and ensure that the tool is using the environment variables and not the values in the yml file. None of the editing variations caused the tool to work.

Expected behavior
After either emptying the values of the yml file key and secrets and setting the environment variables appropriately the tool should connect to acquia.

Desktop (please complete the following information):

  • OS: Mac 10.15.3
    [ - Code version/tag : 1.0.3]
  • Installed as part of project folder and not as phar standalone.

Additional context
Even with a successful connection I get these php warnings:

PHP Warning: Declaration of AcquiaCli\Commands\AcquiaCommand::confirm($question) should be compatible with Robo\Tasks::confirm($question, $default = false) in /Users/dan/work/Phase2/webster/webster-bank/vendor/typhonius/acquia_cli/src/Commands/AcquiaCommand.php on line 19

Warning: Declaration of AcquiaCli\Commands\AcquiaCommand::confirm($question) should be compatible with Robo\Tasks::confirm($question, $default = false) in /Users/dan/work/Phase2/webster/webster-bank/vendor/typhonius/acquia_cli/src/Commands/AcquiaCommand.php on line 19

Update to acquia-php-sdk-v2 2.0

Work has commenced on restructuring the underlying API in typhonius/acquia-php-sdk-v2#34.

This is quite a large restructure as it splits the endpoints into individual classes. The impact will be to completely break the underlying API which means we'll need a new major release. I'll be creating a 2.0 release on the SDK and a corresponding 2.0 release here. I'll also be taking this opportunity to bump dependencies.

New work will go into the 2.0 release and be selectively backported, to 1.x where applicable. New features that will likely be backported (but haven't yet been added in) will be:

  • Logstreaming
  • Integration of waitForTask with Notifications

Error checking when dbName doesn't exist in `acquiacli db:backup:download`

Just putting this here to make things a little bit better, not trying to nit pic :)

Is your feature request related to a problem? Please describe.
When I had a typo in the dbName parameter in the db:backup:download command I just recieved some PHP notice and an error saying a resource didn't exist.

Describe the solution you'd like
Lets throw an error if $backup is an empty arrayobject. Dumping it on line 182 gave me

object(AcquiaCloudApi\Response\BackupsResponse)#595 (1) {
  ["storage":"ArrayObject":private]=>
  array(0) {
  }
}

because the query before returned 0 results.

Additional context
Add any other context or screenshots about the feature request here.
image

300 Second task timeout limit reached

Issue
Due to several lengthy acquia post-code-deploy hooks we are using that regenerate the search index for drupal. Our acquiacli jobs are taking longer than 5 minutes (300 seconds). Thus we get a timeout on the job

acquia_cli-timeout

Notification in-progress                     
 4 mins [⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0%I0521 15:03:09.999927      75 log.go:172] (0xc000676000) Data frame received for 5
 I0521 15:03:09.999957      75 log.go:172] (0xc00082a960) (5) Data frame handling
 I0521 15:03:09.999973      75 log.go:172] (0xc00082a960) (5) Data frame sent
  [error]  Task timeout of 300 seconds exceeded. 
 I0521 15:03:10.088292      75 log.go:172] (0xc000676000) (0xc000696000) Stream removed, broadcasting: 3
 I0521 15:03:10.088368      75 log.go:172] (0xc000676000) Data frame received for 1
 I0521 15:03:10.088378      75 log.go:172] (0xc000403f40) (1) Data frame handling
 I0521 15:03:10.088387      75 log.go:172] (0xc000403f40) (1) Data frame sent
 I0521 15:03:10.088394      75 log.go:172] (0xc000676000) (0xc000403f40) Stream removed, broadcasting: 1
 I0521 15:03:10.088646      75 log.go:172] (0xc000676000) (0xc00082a960) Stream removed, broadcasting: 5
 I0521 15:03:10.089299      75 log.go:172] (0xc000676000) Go away received
 I0521 15:03:10.089478      75 log.go:172] (0xc000676000) (0xc000403f40) Stream removed, broadcasting: 1
 I0521 15:03:10.089655      75 log.go:172] (0xc000676000) (0xc000696000) Stream removed, broadcasting: 3
 I0521 15:03:10.089753      75 log.go:172] (0xc000676000) (0xc00082a960) Stream removed, broadcasting: 5
 command terminated with exit code 1

Sollution Proposal & Question
I don't see anywhere that I can adjust the acquiacli ssh timeouts. Is it possible to make the timeout longer? I know I can use the -no-wait flag to make acquiacli return quickly but this is a CI job that needs to wait for a artifact:deploy job to finish before other jobs start acquiacli c:s (for example).

A nice option to have would be '--ssh-timeout'. Or perhaps change the way the task progress is determined and reported so that it doesn't have to keep a single connection open that long. Perhaps opening a shell to check on the task every thirty seconds or something. I have not tried the --progress-delay option. But that option seems to be only output related and not ssh related.

Describe alternatives you've considered
I've tried making the job faster by limiting the io with these options

--no-ansi
-n
--no-lock
-q

But those didn't eliminate the problem.

Allow different config directory definition

When running acquiaConfigUpdate it assumes 'sync' as the config directory definition:
->drush(['config-import', 'sync'])

Would be great if this could be configurable from the extraconfig or the likes, Acquia for example uses 'vcs' as the default.

"Limit" & "Sort" Options does not work for backups list

Describe the bug
Acquia API V2 supports offset/limit/sort options. Seems that this tool does not support them.

To Reproduce
Steps to reproduce the behavior including calling code:

  1. Call acquiacli database:backup:list {appUuid} {envName} {dbName} --limit 1 for database with few backups
  2. See full list of backups returned instead of one

Expected behavior
Only one database backup is returned

Desktop (please complete the following information):

  • OS: latest macOS & latest Ubuntu
  • 2.0.6

PHP Warning: sem_remove()

PHP Warning: sem_remove(): SysV semaphore 140702091352320 does not (any longer) exist in phar:///usr/local/bin/acquiacli/vendor/symfony/lock/Store/SemaphoreStore.php on line 94

PHP: 7.4.5

Support Windows usage

Over in #57 I've included some variables that would support Windows. I'd like someone with a Windows machine to be able to test out that branch to check that it works.

Other commands which would specifically need testing are:

  • setup
  • drush:aliases
  • log:download
  • database:backup:download

Add in option to automatically respond 'yes' to any question

We have a number of different commands which use the 'confirm' method allowing the user to respond with a y or n to double confirm their intent to use the command. Examples of these are:

  • Disabling livedev
  • Removing domains
  • Deleting cron tasks

Advanced users may wish to make these steps completely automated and it would be good to provide an option that responds 'yes' to any confirmation.

--path to allow you to specify filename so we know exactly where the DB is.

Is your feature request related to a problem? Please describe.
As a user, working on automated deploys, I need the database to be at a specific filename so that my automated script knows where to grab it from.

Example: acquiacli db:backup:download prod:sdsuextension prod sdsuextenstion --path=./references/latest.sql.gz makes a file in the folder ./references/latest.sql.gz with the contents of what ever the backup database file contained.

Describe the solution you'd like
It would be wonderful if the --path argument would take either a directory or a filename. I'm comparing functionality to terminus. Their command allows a --to parameter where you can specify the exact filename.

Describe alternatives you've considered

Other alternatives would be:

  • To return the path somehow... I guess I could always grep the output for it?
  • To return the file as a stream so that we can pipe it to the place we want... example acquiacli db:backup:download prod:sdsuextension prod sdsuextenstion > references/latest.sql.gz
  • To get the link to the latest db, but that requires a logged in session to grab it.

For now I'm going to just do a mv using a glob and move it from an always empty directory to the filename I want like mv /tmp/prod-sdsuextenstion-*.sql.gz ./references/latest.sql.gz`.

Additional context

Here's what happens when I try to do it now

$ acquiacli db:backup:download prod:sdsuextension prod sdsuextenstion --path=./db.sql.gz
PHP Notice:  Undefined offset: 0 in /home/allan/.local/lib/acquia_cli/src/Commands/DbBackupCommand.php on line 157
PHP Notice:  Trying to get property 'id' of non-object in /home/allan/.local/lib/acquia_cli/src/Commands/DbBackupCommand.php on line 157
➜  Downloading database backup to ./db.sql.gz/prod-sdsuextenstion-.sql.gz
    0 [➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬] [error]  Directory ./db.sql.gz does not exist for sink value of ./db.sql.gz/prod-sdsuextenstion-.sql.gz 

Acquia key and secret via environment variable

I would like to add this as part of a docker-based environment where each member of our team has their key and secret stored as an environment variable. We would not want a file containing that information to be placed into the git repository.

Will it read it if the file is set as:

acquia:
  key: ${SECRET_ACAPI_KEY}
  secret: ${SECRET_ACAPI_SECRET}

Or is there another way to accomplish the same thing?

Return output in custom format

Is your feature request related to a problem? Please describe.
It would be great to have commands output in custom formats, let's say in json, or csv, which would allow me to use it in custom CI tools

Describe the solution you'd like

acquiacli domain:list prod:sitename test --format=json

This would output the domains in a json format instead of the current fancy table output.

It would be an out of the box alternative to drush ac-domain-list --format=export

Describe alternatives you've considered
Custom php code to gather info from cloud api v2 using typhonius/acquia-php-sdk-v2

Additional context
Add any other context or screenshots about the feature request here.

Call to undefined method AcquiaCloudApi\Connector\Client::addOption()

Describe the bug
On any command call error happens

To Reproduce
Steps to reproduce the behavior including calling code:

  1. Execute vendor/bin/acquiacli database:list
  2. See error:
    PHP Fatal error: Uncaught Error: Call to undefined method AcquiaCloudApi\Connector\Client::addOption() in /project/vendor/typhonius/acquia_cli/src/Cli/AcquiaCli.php:53 Stack trace: #0 /project/vendor/typhonius/acquia_cli/bin/acquiacli-robo.php(37): AcquiaCli\Cli\AcquiaCli->__construct(Object(AcquiaCli\Cli\Config), Object(AcquiaCloudApi\Connector\Client), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #1 /project/vendor/typhonius/acquia_cli/bin/acquiacli(11): require_once('/proj...') #2 {main} thrown in /project/vendor/typhonius/acquia_cli/src/Cli/AcquiaCli.php on line 53

Expected behavior
Command returns databases list

Desktop (please complete the following information):

  • latest MacOS & Ubuntu
  • 2.0.8

Allow users to override the lock

Is your feature request related to a problem? Please describe.
Sometimes, we might want to run acquiacli in two concurrent processes e.g. to have two log streaming windows open.

Describe the solution you'd like
An override on the command line of the lock functionality built in e.g. --no-lock

Describe alternatives you've considered
N/A

Additional context
N/A

setup:config creates an unwritable ~/.acquiacli directory.

Describe the bug
When the user first configures their account with setup:config, the process fails because acquiacli creates a directory it cannot write to.

To Reproduce

franklin@llama:~$ rm -rf ~/.acquiacli/
franklin@llama:~$ ./acquiacli.phar setup:config
➜                                                                  
➜   Global configuration (/home/franklin/.acquiacli/acquiacli.yml) 
➜                                                                  
?  Global configuration file not found. Would you like to add one? (y/n) y
?  What is your Acquia key? [redacted]
?  What is your Acquia secret? 
➜                                                            
➜   /home/franklin/.acquiacli/acquiacli.yml is not writeable 
➜                                                            
franklin@llama:~$ ls -al .acquiacli/
ls: cannot open directory '.acquiacli/': Permission denied
franklin@llama:~$ ls -ald .acquiacli
d-w-r-xr-T 2 franklin franklin 4096 Nov 20 10:46 .acquiacli
franklin@llama:~$ php -v
PHP 7.3.19-1~deb10u1 (cli) (built: Jul  5 2020 06:46:45) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.19, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.19-1~deb10u1, Copyright (c) 1999-2018, by Zend Technologies
franklin@llama:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster
franklin@llama:~$ ./acquiacli.phar --version
AcquiaCli 2.0.9

Expected behavior
A new $HOME/.acquiacli/acquiacli.yml with the API key.

Desktop (please complete the following information):

  • Debian 10
  • PHP 7.3.19
  • AcquiaCLI 2.0.9

Allow extra config to be controlled by environment variables

Is your feature request related to a problem? Please describe.
We have added in environment variables for Acquia key and secret, it would be useful to also have other config items based on environment variables e.g. timezone.

Describe the solution you'd like
To have each of the following config items controllable with env vars:

  • timezone
  • format
  • taskwait
  • timeout

Describe alternatives you've considered
The $HOME/.acquiacli/acquiacli.yml still works for phar files but may not be good to use in distributed environments.

The API token is expired during the code:switch task

Describe the bug
The API token is expired during the code:switch task if the backup procedure takes more than 5 minutes.

To Reproduce
Steps to reproduce the behavior including calling code:

  1. Perform code:switch task on the environment with big DBs
  2. See error:
➜  Backing up DB (***) on Preprod
Notification in-progress
4 mins [⚬⚬⚬⚬⚬⚬⚬⚬⚬➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]   0% [error]  The access token has expired.

Expected behavior
Database backup is not performed until it was requested in an explicit way (with the separate option).

Option to disable backups when moving DBs

Is your feature request related to a problem? Please describe.
I want to use the cli to copy databases from a multisite with >30 databases. By default database:copy and database:copy:all backup the DBs on the target environment first, which could create a lot of clutter on the server. I've had issue with running out of disk space as well.

Describe the solution you'd like
Add the --no-backup option to database:copy and database:copy:all so you can skip the copy operation.

Describe alternatives you've considered
N/A

Additional context
N/A

Do not perform DB backup during the "code:switch" task until explicitly requested

Is your feature request related to a problem? Please describe.
Backup is performed during the code:switch task which is not suitable for all cases, e.g. performing a deployment to the PREPROD environment with a lot of huge DBs or delivering an urgent hot-fix to the PRODUCTION environment.

Describe the solution you'd like
Do not perform DB backup during the code:switch task until explicitly requested with an additional option.

Describe alternatives you've considered
Create an option to switch off the backup task (to keep the code:switch workflow backward-compatible).

BLT compatibility

Feature request related to Acquia BLT usage
I would imagine many users of acquia_cli would also use acquia/blt. But it appears they are incompatible in terms of composer packages.

Hoped for solution
This feature request is to make them compatible via composer.

Describe alternatives you've considered
Currently we have to install acquia_cli in a different location ( or repo ) so as not to interfere with the current projects composer setup that frequently requires blt. We can continue down this route but that is in-convenient when testing in a CI environment. We could also try using the phar install methods to get around the issue.

Additional context
Current environments tested in are docksal and Gitlab and Acquia Cloud.

Steps to reproduce

mkdir new-repo-test
cd new-repo-test
composer install acquia/blt
composer install typhonius/acquia_cli

I also tried this in the reverse order:

cd new-repo-test
rm -rf *
composer install typhonius/acquia_cli
composer install acquia/blt

Neither of these work at the moment.

Attaching screenshot of error. (Annotated-command & consolidation/robo issue)
blt-acquia-cli-no-bueno

files:copy exits with error "missing source"

Describe the bug
image

To Reproduce
Steps to reproduce the behavior including calling code:

  1. Checkout latest 2.0 release. (currently 7865e08)
  2. run the command ./bin/acquiacli files:copy REALM:SITENAME prod dev
  3. See error

Expected behavior
Other commands are working... just seems to be this one is wonky. Expected to not get an error as this worked with 1.* releases

Desktop (please complete the following information):

  • OS: Linux (on acquia itself too)
  • latest 2.0 branch (7865e08)

Add --latest flag for db:backup:link

Is your feature request related to a problem? Please describe.
I want to automate grabbing the database without having to write PHP code using acquiacli. Currently I have to do some awesome bashfu to get the first item from acquiacli db:backup:list to get the link to the latest backup.

Describe the solution you'd like
I would like to have a --latest option that would automaticallly fetch the backup id from the backup list and provide me a link with that or if I don't provide an id it makes the assumption that I meant to grab the latest... much like terminus works for pantheon terminus backup:get site.live --element=db --to=db.sql.gz

PHP Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Console\Helper\ProgressBar::advance() must be of the type integer, null given

Describe the bug
Getting a PHP Fatal error as soon as a progress bar appears, when attempting to use many cloud operations, using the latest 2.0.2 PHAR.

Full error:

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Symfony\Component\Console\Helper\ProgressBar::advance() must be of the type integer, null given, called in phar:///usr/local/bin/acquiacli/src/Commands/AcquiaCommand.php on line 184 and defined in phar:///usr/local/bin/acquiacli/vendor/symfony/console/Helper/ProgressBar.php:310
Stack trace:
#0 phar:///usr/local/bin/acquiacli/src/Commands/AcquiaCommand.php(184): Symfony\Component\Console\Helper\ProgressBar->advance(NULL)
#1 phar:///usr/local/bin/acquiacli/src/Commands/AcquiaCommand.php(282): AcquiaCli\Commands\AcquiaCommand->waitForNotification(Object(AcquiaCloudApi\Response\OperationResponse))
#2 phar:///usr/local/bin/acquiacli/src/Commands/AcquiaCommand.php(240): AcquiaCli\Commands\AcquiaCommand->backupDb('d9b9dc88-f2c2-d...', Object(AcquiaCloudApi\Response\EnvironmentResponse), Object(AcquiaCloudApi\Response\DatabaseResponse))
#3 phar:///usr/local/bin/acquiacli/src/Commands/DeployCommand.php(38): AcquiaCli\Commands\AcquiaCommand->backupAndMoveDbs('d9b9dc88-f2c2-d...' in phar:///usr/local/bin/acquiacli/vendor/symfony/console/Helper/ProgressBar.php on line 310

To Reproduce
Steps to reproduce the behavior including calling code:

  1. Downloaded the PHAR for release 2.0.2, made executable, moved into /usr/local/bin
  2. Set environment variables ACQUIACLI_KEY, ACQUIACLI_SECRET to credentials.
  3. Attempted to use acquiacli deploy:prepare and acquiacli code:switch under both PHP7.2 and 7.3, and got the same exact error.

Expected behavior
Command to complete successfully.

Screenshots
2020-03-23_16-00

Desktop (please complete the following information):

  • OS: Tried both under Ubuntu 18.04 and 19.10, with PHP from Ubuntu repositories
  • Code version/tag: 2.0.2

Additional context
Trying to set up for a CI/CD system... is there a switch to disable the progress bar? I tried passing -y, -n, --ansi, and even --progress-delay=600s with no difference in the output.

Skipping Drush tasks fails on PROD

Learned this the hard way unfortunately...

in function acquiaDeployProd($uuid, $branch, $skipDrushTasks = false) the variable name $skipDrushTasks is passed to acquiaDeployEnv() incorrectly as $drushTasks so never can be set to true.

Symfony 3

Currently, this cannot be installed on the project that uses Symfony 3 components, like filesystem.

I tried to composer require this project but there were simply too many dependency versions to resolve.

@typhonius any chance you could update the project to work with Symfony 3?
I would hate to fork only to update dependencies.

WaitForNotification timeout (300s exceeded)

Hi, first of all thank you for this awesome tool.
I've been facing a issue in the code:switch command. The code is deployed but the "Notification in-progress" step keeps stuck without response and ends crashing by timeout.

To Reproduce

  1. Just run code:switch command

Screenshots
AcquiaCli_WaitForNotification_TimeOut

Additional context
Not sure if is my Acquia application or the notification that acquia_cli is waiting is not being sent by Acquia anymore.
I'm using Acquia_cli on Jenkins (and testing the commands in my machine, i.e screenshot), and using --no-wait fix the question (don't stuck my build in extra 300s).

Please let me know if I can help somehow. Thanks.

downloading database backups with the acquia_cli doesn't work with the latest version of curl

Description

It is not possible to download database backups on a system that has a recent version of libcurl

To Reproduce

./vendor/bin/acquiacli db:backup:download \
	--progress-delay=15 \
	-n prod:********* \
	dev downloads --path="/tmp" --filename="backup_dl"
➜  Downloading database backup to /tmp/backup_dl.sql.gz
    0 [➤⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬⚬]PHP Warning:  curl_exec(): Cannot call the CURLOPT_PROGRESSFUNCTION in phar:///home/circleci/project/vendor/bin/acquiacli/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php on line 40
PHP Warning:  curl_exec(): Cannot call the CURLOPT_PROGRESSFUNCTION in phar:///home/circleci/project/vendor/bin/acquiacli/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php on line 40

Expected behavior

The database backup is downloaded successfuly

Desktop (please complete the following information):

  • OS: I've seen this both on ubuntu 20 in CI and macOS 12.4

Additional context
I believe this has been patched in guzzle so updating should hopefully fix it

PHP Fatal error: Uncaught Error: Class 'Robo\Config\YamlConfigLoader' not found

I included "typhonius/acquia_cli": "1.0.1" in my composer project, and ran ./vendor/bin/acquiacli setup and I got:

PHP Fatal error:  Uncaught Error: Class 'Robo\Config\YamlConfigLoader' not found in /PROJECTPATH/vendor/typhonius/acquia_cli/bin/acquiacli-robo.php:27
Stack trace:
#0 /PROJECTPATH/vendor/typhonius/acquia_cli/bin/acquiacli(11): require_once()
#1 {main}
  thrown in /PROJECTPATH/vendor/typhonius/acquia_cli/bin/acquiacli-robo.php on line 27

Missed path to project's ./acquiacli.yml when not root package

I suppose acquia_cli is normally used as a root package, as I'm having some trouble getting it to pick up the acquiacli.yml when located in ./vendor. Focussing here: https://github.com/typhonius/acquia_cli/blob/master/bin/acquiacli-robo.php#L10-L35

When i dump $paths I get:

array(3) {
  [0]=>
  string(78) "/PROJECTPATH/vendor/typhonius/acquia_cli/default.acquiacli.yml"
  [1]=>
  string(34) "/Users/si/.acquiacli/acquiacli.yml"
  [2]=>
  string(84) "/PROJECTPATH/vendor/typhonius/acquia_cli/bin/../../..//acquiacli.yml"
}

and the third one is ./vendor/acquiacli.yml, when it should be ./acquiacli.yml according to the docs - missed it by one.

I don't know what the right solution is, but I'll do a patch to check for getcwd() . '/acquiacli.yml - since on my machine getcwd() returns the project root.

Remove Cloudflare code

As this is the Acquia Cli, I'm going to remove the Cloudflare code and dependencies as part of the 2.0 release.

Code Switch error

Describe the bug
"acquiacli c:s uuid branch environment" seems to fail on the second parameter.

To Reproduce
Steps to reproduce the behavior including calling code:

  1. composer global require typhonius/acquia_cli:2.0.x-dev
  2. authenticate with acquiacli setup
  3. acquiacli c:s uuid tags/asdf dev

Expected behavior
This command should switch the "dev" server to the tags/asdf branch.

Screenshots

codeSwitch-bug-

Desktop (please complete the following information):

  • OS: Debian Linux 10
  • Code version/tag 2.0

Additional context
Error output

Fatal error: Uncaught TypeError: Argument 2 passed to AcquiaCli\Commands\CodeCommand::codeSwitch() must be an instance of AcquiaCloudApi\Response\EnvironmentResponse, string given in /home/docker/.composer/vendor/typhonius/acquia_cli/src/Commands/CodeCommand.php:111
Stack trace:
#0 [internal function]: AcquiaCli\Commands\CodeCommand->codeSwitch('3d2cc3e2-d32d-4...', 'qa-build', Object(AcquiaCloudApi\Response\EnvironmentResponse), Array)
#1 /home/docker/.composer/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#2 /home/docker/.composer/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#3 /home/docker/.composer/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#4 /home/do in /home/docker/.composer/vendor/typhonius/acquia_cli/src/Commands/CodeCommand.php on line 111

Too many arguments, expected arguments "command" "environmentId" error when using "code-switch"

Describe the bug
When running this command

acli api:environments:code-switch myapp.dev "my-feature-branch"

... the process fails with the following error

In ArgvInput.php line 171: [Symfony\Component\Console\Exception\RuntimeException] Too many arguments, expected arguments "command" "environmentId". Exception trace: at phar:///usr/local/bin/acli/vendor/symfony/console/Input/ArgvInput.php:171 Symfony\Component\Console\Input\ArgvInput->parseArgument() at phar:///usr/local/bin/acli/vendor/symfony/console/Input/ArgvInput.php:82 Symfony\Component\Console\Input\ArgvInput->parse() at phar:///usr/local/bin/acli/vendor/symfony/console/Input/Input.php:55 Symfony\Component\Console\Input\Input->bind() at phar:///usr/local/bin/acli/vendor/symfony/console/Command/Command.php:217 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/acli/src/Command/CommandBase.php:243 Acquia\Cli\Command\CommandBase->run() at phar:///usr/local/bin/acli/vendor/symfony/console/Application.php:929 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/acli/vendor/symfony/console/Application.php:264 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/acli/vendor/symfony/console/Application.php:140 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/acli/bin/acli:95 require() at /usr/local/bin/acli:12 api:environments:code-switch [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--] <command> <environmentId>

This error has been reproduced on own environments too.

Could you please help us investigate why ? Thanks

Sophie

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.