Information for: DEVELOPERS   PARTNERS

Getting started with Cloud IDE

The Cloud IDE lifecycle can be managed either through the Cloud Platform user interface or Acquia CLI. Complete the following steps to create and manage your IDE.

Creating a Cloud IDE through the Cloud Platform user interface

Important

The Cloud IDE UI integration with the Acquia Cloud Platform UI is enabled for all subscriptions with two or more IDEs. It’ll be available to all subscriptions later this year.

To create a Cloud IDE:

  1. Sign in to the Cloud Platform user interface and visit your application dashboard.

  2. Go to Actions > Create Cloud IDE.

    create-cloud-ide

  3. Specify a name for your IDE and click Submit.

    add-ide-label

    While the IDE gets provisioned, the system displays a spinner on the card. The IDE is available within a few minutes.

    GitHub's add new SSH key page

    Once the IDE is ready, the updated card displays the IDE URL and the owner.

  4. To launch the IDE in a new tab, click Launch Cloud IDE.

    ide-card

Creating a Cloud IDE with Acquia CLI

To create a Cloud IDE:

  1. Install Acquia CLI
  2. Sign in to the Cloud Platform user interface.
  3. Open your local terminal application.
  4. From the command line, authenticate against the Cloud Platform API and follow the prompts.

Note

If you’ve already authenticated against the Cloud Platform API, you don’t need to authenticate again.

acli auth:login
  1. From the command line, create the Cloud IDE and follow the prompts.
acli ide:create

Once the IDE is created, Acquia CLI will display a link to your IDE and a link to the Drupal application hosted within the IDE. You can open your IDE at any time by running the following command from your terminal and selecting the IDE you wish to open:

acli ide:open

Review all commands to manage your IDE lifecycle.

For information about changing preferences in Cloud IDE, see Settings and preferences.

Configuring your Cloud IDE

Once you have created a Cloud IDE, you must configure it so that it can authenticate with the Cloud Platform.

Configuring your Cloud IDE from the user interface

  1. From within your Cloud Platform application page, identify the relevant Cloud IDE card and click on the Launch Cloud IDE button.

  2. In the Cloud IDE Get Started Page, click CONFIGURE IDE to connect the IDE to your Cloud Platform account. This authenticates the IDE with the Cloud Platform API and then automatically generates an SSH key that is linked to your Cloud Platform user account.

    Cloud Platform IDE Get Started page

Configuring your Cloud IDE with Acquia CLI

  1. From the command line on your local computer, run the following command to open your IDE and select the IDE you wish to open:

    acli ide:open
    
  2. In the Cloud IDE Get Started Page, click CONFIGURE IDE to connect the IDE to your Cloud Platform account. This authenticates the IDE with the Cloud Platform API and then automatically generates an SSH key that is linked to your Cloud Platform user account.

    Cloud Platform IDE Get Started page

Cloning your Cloud application into your IDE

Once you have created your IDE and configured your IDE, you must clone your Cloud Platform application into your IDE.

To clone your Cloud Platform application into your IDE:

  1. Click the COPY FROM THE CLOUD PLATFORM button to copy your existing Cloud Platform application into the Cloud IDE. This will copy your application’s code, databases, and files into the Cloud IDE.

    Note

    Alternatively, you can use acli pull to pull your code, database, and files from the Cloud Platform. You can use optional parameters to specify what you don’t want to refresh. Use acli pull --help to get the list of all available parameters.

    clone_1

Cloning your application from a GitHub repository to your IDE

To clone your application from a GitHub repository into your IDE, complete the following steps:

  1. Copy the contents of your IDE SSH public key at /home/ide/.ssh/id_rsa_acquia_ide_<UUID>. Make sure to replace the following example code with your own IDE SSH public key:

    $ cat /home/ide/.ssh/id_rsa_acquia_ide_<UUID>.pub
    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDia6OKJKFQYmQysWWL6+bRpjfGbGHaYx3b9mdqhRxtBr9
    +q1TUUljNPX3dT6y+GsQEC4ImAhm82fPpFjEpwPGrM5+kvlk4zkLMV+TILnQXA9athf3CWPTCUQxyY9t5ZO
    wbmjRPhFeDKCVogSAjHdCoVRQfKOy1J0ffO+I7nnjVNbhMLfeL1PU1WZhyx4tBRweKX44QZA1hccrIfw0SV
    rXnJ72Gm/0SESnCaAkfnEjo8+wwyiSNfTFOfY/MrgkNjePaxTPP0LaFwoiGpfyNRNAd6w+ztfIQa34kfviT
    NCp4Us/cGrtLH6AYvrtVbIwToNdXvTPliz+D1GJYcaWlbfdwHselKDQffVbnYLbpgopWgDJjmy/ex0TG4Gv
    Qnn1CVHZayKbivuVT0sEgcWrOmyKcqpO2PlZ+W4SCpCdQZ3Tz6I0I+O9VKLF2lauKtjHkmpfOxI46YkLEA8
    6sTuK3s9cyt8irn9X/4ggV7D4PbiYdaweQMjRgQPVhLcB+dosDml750bnEGjjY1iFJwIbT69gF5zucrheIr
    zr6OarwPjwW1V314sKfszssjSYpablgYYm/8zOjowKpgf+6XS0Ug0aKePWRPUVfSdnn5fDBEr9U3K4r3cv5
    L6Ol0GIJVcfEi7Vq6OsmDxgiEfAzKdpXaHZBwacpATrawZ0DQqr58V/xCw== [email protected]
    4ba0-b737-13187c3c8b96-6799564b7d-rbn58
    
  2. Paste the SSH public key into the Key field at https://github.com/settings/ssh/new:

    Github's add new SSH key page

  3. You can clone your repository into the correct folder in the IDE with the following command, replacing [your-URL.git] with the Git URL of your repository:

    git clone [your-URL.git] /home/ide/project
    

    Note

    When pulling the code from an external Git repository, you can use acli refresh --no-code to only pull the database and files from your Cloud Platform application.

View your application within Cloud IDE by clicking Open Drupal Site in the admin menu. Then click Open site in a new tab to open the application in a new tab in your browser. Clicking Open Site in the IDE alone will open the application in the Preview pane.

Pushing your changes back to the Cloud Platform

Acquia Cloud IDE is primarily used to develop an existing Drupal application. But there are cases when you might need to push your database or files to the Cloud Platform, e.g. if you’re creating a new project. We’ve made this easy for you with Acquia CLI’s push sub-commands.

Pushing your code

Running acli push:code will not push your code to the Cloud Platform. Instead, it will recommend you use Git, which is following best practices, and the only way to update your code on the Cloud Platform.

ide:~/project (master) $ acli push:code
Please use git to push code changes upstream.

Pushing your database

Important

This operation is destructive. Make sure you know what you’re doing!

Running acli push:database will allow you to push the Cloud IDE database to any non-production Cloud Platform environment and target database.

ide:~/project (master) $ acli push:database
Using Cloud Application mydrupalapp

 Choose a Cloud Platform environment:
  [0] Dev, dev (vcs: pipelines-build-master)
  [1] Stage, test (vcs: tags/2020-10-19)
 > 1

 Choose a database [mydrupalapp (default)]:
  [0] mydrupalapp (default)
  [1] drupal9
 > 0

 Overwrite the mydrupalapp database on test with a copy of the database from the current machine? (yes/no) [yes]:
 > yes

    ✔ Creating local database dump
    ✔ Uploading database dump to remote machine
    ✔ Importing database dump into MySQL on remote machine

Pushing your files

Important

This operation is destructive. Make sure you know what you’re doing!

Running acli push:files will allow you to push the Cloud IDE files to any non-production Cloud Platform environment and target files directory.

ide:~/project (master) $ acli push:files
Using Cloud Application mydrupalapp

 Choose a Cloud Platform environment:
  [0] Dev, dev (vcs: pipelines-build-master)
  [1] Stage, test (vcs: tags/2020-10-19)
 > 1

 Choose a site:
  [0] default
 > 0

 Overwrite the public files directory on test with a copy of the files from the current machine? (yes/no) [yes]:
 > yes

    ✔ Pushing public files directory to remote machine