Git offers a few workflow options for managing your code releases but on Acquia Cloud, we strongly recommend using Git tags for your Production environment for the following reasons:
- It will make it easier for the team to roll back changes to the previous release/tag in case something goes wrong with the new release that is being deployed.
- It helps you keep track of the release/version number of your project, and refer to that release number when talking with other members of the team.
- It allows you to document the release notes of your project, which is useful for your team and stakeholders.
- It allows you to compare changes between two separate releases.
- It allows you to deploy a previous release in your local in case you need to investigate when issues that are hard to identify were introduced.
- It helps reduce the risk of untested code getting accidentally deployed to Production when pushing to Acquia Cloud.
Tagging off of master
In general, most workflows will involve creating a tag after merging the feature branch (where the development work is being done) into master. Let's say you have merged your feature branch into master and are ready to deploy that release. Our default tag format is yyyy-mm-dd.version and if you are on version 1, then you can create the tag by running the following commands:
$ git fetch
$ git checkout master
$ git pull
$ git tag -a 2019-10-02.1 -m "my release message"
$ git push --tags
This will make sure you have the up-to-date repo/master branch, tag the branch with your specified tag name, and then push it up to your application on Acquia Cloud. You should then be able to follow our Code workflows with Acquia Cloud documentation to deploy that tag to the desired environment.
Checking out a git tag locally
Perhaps you've noticed a small bug in your application after deploying a release via a tag and need to make some changes. You can accomplish this by running the following:
$ git fetch
$ git checkout tags/2019-10-02.1
Your local repo should now be on the desired tag!
Pro Tip: Check for changes in traffic after code deployments
After your code has been deployed and traffic has been accessing the site for a few hours, it's a good idea to see if there have been any significant changes in traffic patterns. You can easily download your logs directly from the Cloud UI: https://docs.acquia.com/cloud-platform/monitor/logs/#cloud-download-logs-ui
- Check your Apache logs for any significant increase of uncached pages after cache has
- Check your Views & Visits for unexpected increases.