Working with code

The Cloud Platform interface gives you powerful and easy-to-use tools for managing your application’s code in its version control system.

Understanding the repository directory structure

For each application, Cloud Platform creates a master branch with the following three folders:

  • /acquia-utils - Contains the application code and files for your development area. In the initial configuration, Cloud Platform deploys code from this directory to both your production and staging infrastructure.

  • /docroot - Stores the development copy of your Drupal codebase, from which Cloud Platform executes on your infrastructure if you select master as the deployment branch.

  • /library - Contains the PHP libraries for your application. This directory is in your PHP include path, so you can add PHP extensions here if needed.

Adhering to code management recommendations


Back up your databases before deploying code. This database backup will create a stable and recent rollback point, minimizing data loss, if your code deployment must be reverted.

Develop your code management workflow on the following best practices and requirements to manage code in your version control system and environments:

  • Master is always a stable, up-to-date codebase. This means that the master is immediately able to be deployed to production unless updates are in process. The master is deployed to the Dev environment unless testing is in process.

  • Branches are used for developing and testing new code and updates. Branches will be taken from the production tag. Acquia labels branches according to the function, the date and time started.

  • Development can happen in parallel on different branches. Acquia recommends keeping track of changes that are eventually merged into master and regularly updating the branch with master to ensure that the working branch is up-to-date. This may or may not be possible depending on the type of development on the branch.

  • All tested and approved branches should be merged back into master. Once they are fully tested, you should merge development branches into master. This ensures that master always includes updated code.

  • Tags from tested and approved branches (including the master) are used for production. Tags are similar to snapshots of the code, frozen in time. The Cloud Platform interface doesn’t allow you to make commits on a tag. By not modifying tags, you can easily go back to a previous tag if an error is discovered on the most recent tag.

  • Deployed branches cannot be deleted. Ensure that your workflow accounts for Cloud Platform not allowing you to delete branches that are deployed to an environment.