Testing your feature branches

Managing your PaaS subscription

At some point (possibly based on required features being completed or some calendar-based deadline) you will determine that you need to release the features that you have completed. Before you do this, however, complete the following steps to ensure that there aren't any issues before you deploy your code to your production websites:

  1. Merge your feature branches into a single release branch.
  2. Prepare your development and staging environments with copies of your production websites for testing.
  3. Deploy your new feature branch for testing your websites on your development and staging environments.

Merging your feature branches

To merge your feature branches into a single release branch for testing, complete the following steps:

  1. Create a release branch from your master branch. You will use this branch for feature integration and testing. Use the following steps to create the branch:
    1. Switch to the master branch.

      git checkout master
      git pull origin master
    2. Create the release branch (in this example, the release branch is named RC), and then switch to the new branch.

      git checkout -b RC
  2. Run the following command to ensure that you have the most recent feature branch versions:

    git fetch all
  3. Merge each of the completed feature branches into your new release branch, using a command similar to the following:

    git merge [feature_id] --no-ff
  4. Push your release branch to the remote repository for testing.

    git push origin RC

Staging websites for testing

After you create your release branch, copy one or more production websites to your development (Dev) and staging (Test) environments (also called staging your websites) for use with testing your release branch.

Staging concepts

Staging your websites moves your websites from production (Prod) to non-production (Dev or Test), while also sending the multisite management information that is required by Acquia Cloud Site Factory to those environments.

The staging process overwrites the Site Factory and selected websites on the Dev and Test environment with copies from the Prod environment. This effectively deletes everything in the Test environment.

After Acquia Cloud Site Factory completes the copy process, it scrubs user account and configuration information by removing them from the staged websites.

Copying websites for testing

To copy a website to the Dev or Test environment:

  1. Visit the Staging deployment page on your Prod environment's Factory server. Complete the following steps based on your current signed-in location:

    Staging sites from Prod to Test or Dev

  2. Select the environment to which you want to deploy (either test or dev).
  3. Select one or more websites that you want to copy to your Dev or Test environment. To do this, in the Choose sites to deploy field, start typing the name of a site in the field, then select the site name from the menu.

  4. Click Deploy.

Acquia Cloud Site Factory starts the staging process by copying the selected websites and the Site Factory Management Console to the environment you selected. Although the staging process copies the files and databases associated with each selected website, it scrubs the websites of personal data, including the email addresses of user accounts.

As a result, to sign in to either a staged website or the Site Factory Management Console on the Dev or Test environment, you may not be able to use your usual email address. By default, the scrubbing script replaces your email address username with userXXXXX (where XXXXX is your user account number). You can either sign in using this scrubbed username, or you can follow the procedures described in Protecting Site Factory accounts during staging or Protecting hosted website accounts during staging to keep your email address from being scrubbed.

For both a list of information scrubbed by default from staged websites and instructions for creating a separate scrub script to remove custom website information that you do not want to copy to staging, see Scrubbing sensitive data from staged sites.

Deploying code to staged websites

Deploy your release branch to the websites you staged to the Dev or Test environment to ensure that there are not any errors or branch integration issues. To do this:

  1. Visit the Site update page on your Dev or Test environment's Factory server. Complete the following steps, depending on where you are currently signed in:
    • Acquia Cloud
      1. Sign in to Acquia Cloud at https://insight.acquia.com.
      2. Go to Cloud > Workflow, and then click the Update code link for the Dev or Stage environment.

        If you are not already signed in, you will be redirected to a sign-in page. Sign in using an account that's been assigned the release engineer role.

    • Acquia Cloud Site Factory
      1. Sign in to your Dev or Test environment’s Site Factory Management Console using an account with the release engineer role.
      2. In the admin menu, click Administration, and then click the Update code link.
  2. In the Start time section, select from the following options to control when Acquia Cloud Site Factory will start the code update process:
    • Immediately - Starts the code update process when you click Update.
    • At a specific time - Starts the code update process at a specific time. In the Time field that appears, enter a time using the strtotime format, which can include specific or relative values that include the following examples:
      • Date and time: Mon Feb 24 13:28:38 2014 - 13:28:38 GMT on 24 February 2014
      • Unix timestamp: @1393248518 - 13:28:38 GMT on 24 February 2014
      • Relative time: 5 hours - Five hours from the current time
  3. In the Site update action section, in the Choose a path to deploy list, click the release branch that you want to test.
  4. After you select your release branch, select the action that describes the type of code update you want to deploy from the following options:
    • Code only - Causes the update to set only the version control system (VCS) code path, which it does for all of the websites at the same time. This can reduce the time required to complete the process.

      Select this option only if you meet both of the following conditions:

      • The release branch does not contain any update hooks.
      • Your code does not require a cache clear or a registry rebuild.
    • Code and databases - Causes the update to sync the environment's VCS path names, manage the websites' custom domain names, and complete the following steps for each website, from one to the next:
      1. Inspects the website to ensure that it does not have any known issues
      2. Enables maintenance mode for the website
      3. Puts the code on the website
      4. Runs updates
      5. Clears the website's cache
      6. Disables maintenance mode
    • Code and databases, and rebuild registries - Causes the update to complete all of the actions from the Code and databases option, while also rebuilding the registries.

      Select this option if you have moved files around in your code repository since the last time you sent code to the environment (for example, moving an installed module from /sites/all/modules to /sites/all/modules/custom).

  5. Click Update.

Acquia Cloud Site Factory begins the update process for the staged websites. If you encounter errors during the update, examine the At a glance section on the Site update status page. For more information about resolving update errors, see Resolving codebase update errors.

After you have successfully deployed the release branch on the Dev or Test environment, you can test your updated, staged websites that contain your changes to the codebase.

If you need to deploy an updated release branch, use the previous steps for deployment and testing.

Troubleshooting: Is settings.php included in .gitignore?

The sites/default/settings.php file is written by acsf-init when you prepare a custom Drupal distribution for development and deployment on Acquia Cloud Site Factory. If you find that you are unable to create new websites using your custom Drupal distribution, check the .gitignore file in your code repository. It may be that your .gitignore file is set to exclude the settings.php file, so settings.php never gets pushed to the Acquia Cloud Site Factory. If your .gitignore file has a line like this:

#Ignore configuration files that may contain sensitive information.

delete it from .gitignore. Then, commit and push your code again, as described in Preparing for the code deployment.

Next step

After you finish testing your integrated feature branches, you can deploy your code changes to your production websites.

Contact supportStill need assistance? Contact Acquia Support