Deploying your code to production

Managing your PaaS subscription

After you have finished testing the release branch that you want to use, you can deploy the completed features to your production websites.

Preparing for the code deployment

Use the following steps to prepare your code to be deployed to your production websites.

  1. Ensure that you're using the release branch that you tested with your staged websites.

    git checkout RC
  2. Merge the release branch back into the master branch.
    1. Create a RELEASE.txt file in the sites/all folder (or edit the file if it already exists) and note the feature branches that you’ve merged into the release branch.

      If you haven't yet created the RELEASE.txt file, use the following command to do so:

      git add docroot/sites/all/RELEASE.txt
    2. Commit the changes to the RELEASE.txt file.

      git commit -m "Updated RELEASE.txt for [ver]"
    3. Switch to the master branch.

      git checkout master
      git pull origin master
    4. Merge the release branch into the master branch.

      git merge --no-ff RC
  3. Create a tag on the master branch that references the release branch merge, and then push the changes to the code repository.

    git tag -a [ver] -m [log message]
    git push origin master
    git push origin --tags

Deploying your code

After you create a new tag in your master branch, update your production websites to use the tag by using the following steps:

  1. Visit the Site update page on your Prod environment's Factory server. Complete the following steps based on your current signed-in location:
    • Acquia Cloud
      1. Sign in to the Acquia Cloud interface at
      2. Select your application and the Prod environment, and then click the Update code link.

        If you're not already signed in to your Acquia Cloud Site Factory Prod environment, you'll 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 Prod 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, based on the GMT time zone. 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 2016 - 13:28:38 GMT on 24 February 2016
      • Unix timestamp: @1393248518 - 13:28:38 GMT on 24 February 2016
      • Relative time: 5 hours - Five hours from the current time
  3. In the Stack section, select the Site Factory stack whose code you are updating.
  4. In the Site update action section, in the Choose a path to deploy list, click the tag that you created in the Preparing for the code deployment section.
  5. After you select your tag, select the same option that you selected during the staging deployment process.
  6. After you select the appropriate check box to confirm that you are aware that you are updating your production environment, click Update.

Acquia Cloud Site Factory begins the update process. All production websites are updated with the code from the specified tag.

You can track the status of the update on the At a glance section on the Site update status page.

If you determine that your code update contains an error that affects your websites, you can pause the code update process and upload revised code in an effort to resolve the issue. For more information about this process, see Hotfixes during a paused code update.

For more information about resolving update errors reported on the Site update status page, see Resolving codebase update errors.

Cleaning up your environment

After you have completed a release, it is a best practice to remove the now unneeded branches.

To start the cleanup process, run the following command for each feature branch that you merged into the release:

git branch -d [feature_branch]

Run the following command to remove the now unneeded release branch.

git branch -d RC

Contact supportStill need assistance? Contact Acquia Support