Service Offerings

Command line interface

ach-cli is a command line interface for users to interact with Acquia China Managed Service. It is installed on each server of China Managed Server. With Acquia China CLI, you can:

  • Trigger code deployment

  • Import the database file

Prerequisites

Ensure that you have SSH access to the server for each environment.

Deploying code with ach-cli

  • Run the following command to deploy code with a specific branch:

    ach-cli deploy -e <environment> -b <branch>
    
  • Run the following command to check the deployment history:

    ach-cli deploy list
    # return example
    +----+--------+---------+-------------------------+----------+
    | ID | NUMBER | RESULT  |        BUILDTIME        | DURATION |
    +----+--------+---------+-------------------------+----------+
    | 74 |     74 | SUCCESS | 2021-08-16 02:05:46.000 | 164s     |
    | 73 |     73 | SUCCESS | 2021-08-09 05:56:33.000 | 210s     |
    | 72 |     72 | SUCCESS | 2021-06-30 07:38:38.000 | 161s     |
    | 71 |     71 | SUCCESS | 2021-06-29 09:03:45.000 | 155s     |
    | 70 |     70 | SUCCESS | 2021-06-29 08:59:10.000 | 152s     |
    | 69 |     69 | FAILURE | 2021-06-29 08:54:35.000 | 213s     |
    | 68 |     68 | FAILURE | 2021-06-29 08:43:45.000 | 228s     |
    | 67 |     67 | SUCCESS | 2021-06-29 02:55:20.000 | 110s     |
    | 66 |     66 | SUCCESS | 2021-06-29 02:50:40.000 | 113s     |
    | 65 |     65 | SUCCESS | 2021-06-29 02:46:45.000 | 117s     |
    +----+--------+---------+-------------------------+----------+
    
  • Run the following command to check the detail of a deployment job with ID:

    ach-cli deploy describe <Build ID>
    

Importing the database with ach-cli

China Managed Service does not support the drush sql-import command. Therefore, you must use the ach-cli sql-import command to import the database from sql files.

  • Run the following command to import the database with the .sql extension:

    ach-cli sql-import -l <site alias> < db.sql
    
  • Run the following command to import the database with the .sql.gz extension:

    zcat db.sql.gz | ach-cli sql-import -l <site alias>