In my last project, Continous Integration (CI) and Continous Delivery (CD) were required because the web application is updating were frequently and we are developing test-driven. Therefore, I decided to use Gitlab CI as a CI service because it supports us to provide the code quality. After each pushed commit, the test suite is started and if the test did not pass, our code will stop processing (e.g. not released).
With all these features, we ensure that our code will always pass the tests. But the next (and maybe most important) step is to push our code to our server. We decided to use Amazon AWS for hosting our code because it provides us a flexible and scalable infrastructore. In particular, we are using the AWS Elastic Container Service (ECS) because we wrap our software in docker containers.
Now, we had to deliver our code from the Gitlab CI to the AWS infrastructure. Therefore, you can simply create a cluster for our project as well as tasks for the developed different, independent software components. The main workflow should be that after all tests passed in the Gitlab CI, the docker with the to be deployed source code container should be pushed to a registry and after that ECS should be notified about the newer version that a new container instance should be created and replace the old version.
This plan is very abstract, so let`s getting a little bit more concrete:
In our case, we used also the Gitlab CI as the Docker Registry because you can store there also your docker images. In the following text, I will describe how you can deploy your code step by step to ECS: