A Robo CLI tool for integrating with Acquia CloudAPI and Cloudflare
- Obtain your API key and secret
- 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.
./vendor/bin/acquiacli setupwhen used as a dependency in another project) which will ask for your credentials and automatically create this file.
./bin/acquiacli drush:aliasesto download your available Drush aliases. Follow the instructions output by the command to install them.
Alternatively, follow the below steps for a manual installation.
- Copy the
default.acquiacli.ymlfile to your project root and name it
- Add your Acquia key and secret to the
- Optionally add your Cloudflare email address and API key to the
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:
- Firstly, default configuration from
default.acquiacli.ymlin the project root is loaded.
- Next, if it exists, global configuration from
- Finally, if it exists, an
acquiacli.ymlfile in the project root will be loaded.
The global and per project files may be deleted (manually) and recreated with
./bin/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
|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.|
|configsyncdir||sync||A directory to be passed to the config-import command for syncing config.|
Some of the following commands have aliases for simplicity e.g.
environment:info has the alias of
# Show which applications you have access to. ./bin/acquiacli application:list # Show detailed information about servers in the prod environment (assuming sitename of prod:acquia obtained from site:list command) ./bin/acquiacli environment:info prod:acquia prod # Copy the files and db from alpha to dev for testing new code ./bin/acquiacli preprod:prepare prod:acquia alpha dev # Deploy the develop-build branch to the test environment and run all config update steps ./bin/acquiacli preprod:deploy prod:acquia test develop-build # Get a list of organizations you have access to and display organization UUIDs. ./bin/acquiacli organization:list # Add a new team to an organization. ./bin/acquiacli team:create f5626a0a-5ed8-4868-b7aa-c5e91de666b5 'External Contractors' # Add a new role to an organization (Use permissions:list to get available permissions for the new role). ./bin/acquiacli role:add f5626a0a-5ed8-4868-b7aa-c5e91de666b5 '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). ./bin/acquiacli team:addapp prod:acquia d2693c6e-58e7-47e5-8867-e2db88c71b8c # Add a user to a team and assign roles (Use role:list to obtain the role UUIDs). ./bin/acquiacli team:invite d2693c6e-58e7-47e5-8867-e2db88c71b8c 'firstname.lastname@example.org' f0b89594-0fc5-4609-935f-1f18c313c6c7 # Get a list of DNS records for the foobar.com domain in Cloudflare ./bin/acquiacli cf:list foobar.com # Add a record for www.foobar.com to point to 127.0.0.1 in Cloudflare. ./bin/acquiacli cf:add foobar.com A www 127.0.0.1
If a command takes an application UUID as a parameter, it can be provided in one of two manners:
- The Acquia hosting ID (without hosting realm) e.g. acquia
- The full Acquia hosting realm and ID e.g. prod:acquia
- The application UUID
Both the UUID and the hosting ID (with realm) for your applications may be discovered by running
If no hosting realm is provided, prod is used by default. This can be overridden in the command by specifying a realm e.g.
Environment parameters take the label name of the environment e.g. dev
All other parameters are currently provided in the UUID form, including but not limited to:
- Role ID
- Team ID
- Organization 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.
$uuidis converted to the UUID of the application
$environmentis converted into an EnvironmentResponse object
$environmentFromis converted into an EnvironmentResponse object
$environmentTois converted into an EnvironmentResponse object
A phar archive can be created to run Acquia Cli instead of utilising the entire codebase. Because some of Acquia Cli relies on user configuration of email/password, it is currently most appropriate to allow users to generate their own phar files inclusive of their own configuration.
- Download and install the box project tool for creating phars.
- Follow the Getting Started section above to download and configure Acquia Cli.
box buildin the directory that Acquia Cli has been cloned and configured in. This will use the packaged
box.jsonfile to create a phar specifically for Acquia Cli.
- Move acquiacli.phar to a where it will be used. acquiacli.phar contains your secret email and password information as well as the code required to run Acquia Cli. The phar is now a customised and standalone app.