In this module, we're going to be setting up a process called Continuous Deployment, more commonly shortened to "CD".
CD has many applications, but most typically it's used as a workflow for deploying code to a production environment and is a best practice for enterprise web app deployment.
The advantage of using continuous deployment is that it ensures your app is deployed quickly and easily and minimizes deployment errors.
CD achieves this firstly by bundling all the steps of deployment into a script, allowing you to trigger a deployment with a simple git push. This not only saves you time, but also removes the possibilities of errors as you no longer need to remember all the deployment steps.
Secondly, CD will automatically run your tests, ensuring code changes are deployed conditional on all the tests passing.
Let's now take a look at what we'll be covering in this module.
We'll begin with a detailed introduction to CD, including an explanation of the difference between continuous deployment and continuous integration.
We'll then learn how to set up continuous deployment using a popular services GitLab CI.
Next we'll create a config YAML file to tell GitLab the various stages of our CD workflow including defining jobs to automatically run our unit and E2E tests.
Then we'll learn how to optimize our CD pipeline to ensure it runs quickly and efficiently.
Next, we'll deploy PrintBay to a Heroku production server. As part of this, we'll create an optimized server script so that our app is ready for scaling when our website traffic increases.
Finally, we'll create a deploy script to complete our CD pipeline so that new code changes can be deployed with a simple git push.
Checking out code
Before we begin coding, be sure to checkout the module 9 starter code by going to the terminal and typing:
$ git checkout module_09_start
$ npm i
Don't forget to check that you've got your dot env files set up and seed your database by running:
$ npm run seed