In this article, we’ll be setting up an environment for automated building, testing, and deployment, using containers and services hosted in the cloud.

I’ll be assuming that you already have some knowledge of what CI/CD is, and you’re looking to implement its ideas on your project. Furthermore you must have some previous knowledge of Docker, some of basics AWS services, and software engineering in general.

Given we’re working with Docker, the technology you’re using is not so important. But for this tutorial, we’ll be using Flask for its simplicity.

First things first, let me present to you our tools. For our code repository, we’ll be using Github. We need a CI tool to build, run the tests, and deploy our application (if everything goes well). And for that, we’re taking Travis-CI. For last, we need somewhere to host our application and, since we’re talking Docker, let’s use AWS Elastic Container Service (ECS).

Now let’s see how the workflow works:

Image for post

Every time a commit or a merge is done to a branch, Travis will be triggered and run a list of instructions to build and run our tests. If the build is done successfully and every test passes, Travis will push our Docker image to Docker Hub and trigger an update event on ECS, telling to our cluster that has a new image version to be downloaded.

#devops #pipeline #cicd #docker #aws

Creating a CI/CD Environment and deploying Containers in the Cloud
1.20 GEEK