TDD in Legacy Code - Part 2 - Pipeline Release Stage
In Legacy Code, releases might be manual, which is inconvenient for ATDD. Let's see how to introduce automated releases, before starting ATDD.
This article is part of the premium TDD in Legacy Code series. Ask me any questions and get feedback on your GitHub project in the comments section.
Legacy Code often has Manual Releases
In Legacy Code, the release process might be manual. This means there’s a written procedure that documents all the deployment steps - for example, manually setting up the environment, manually deploying the artifacts to an environment, manually running database migration scripts, and manually opening up the app after the deployment to make sure that it’s up and running.
Manual Releases are inconvenient for ATDD
The problem with manual releases is that they are time-consuming and error-prone. Manual Releases are not reliable. For example, we can deploy to the UAT Environment, and it’s fine, but if we make a small error in the deployment to the Production Environment, the system doesn’t work for the end users.
Furthermore, Manual Releases would make it inconvenient for us to practice ATDD. Since we may need to run Acceptance Tests on the pipeline multiple times a day, this isn’t practical if the releases are manual.
We should have a Release Stage to support ATDD
Before we start with ATDD, we need to ensure that we set up an automated release process. That’s why we need a Release Stage in our Pipeline. The Release Stage automates environment configuration and deployment of our system environments, as well as basic smoke testing of the system. By eliminating manual activities in the deployment process, we gain both safety and speed, eliminate deployment errors, and perform deployment fast anytime.
Previously, we set up the Commit Stage, which resulted in publishing the Docker Images for the Docker Registry. In this article, we will be looking at the Release Stage - deploying the Docker Images to environments.
Here are the steps for adding the Release Stage to Legacy Code. You’ll also have a Homework Task whereby you can make your GitHub project based on these steps, and I will review it in the comments: ⬇️⬇️⬇️