This is a CI/CD Model for building and updating docker images from github as a repo and ecs and a target.
This setup does the following:
- Creates a source(repo) as github where the dockerfile, sourcecode(Javafiles) as well as configurations(buildspec) and uri of image, etc., are stored.
- Once this source is created, the pipeline can then be connected by linking this repo as source in the first stage of the codepipeline.
- In the second stage, codebuild takes the dockerfile and javafiles and creates an image with it.
- the image created is the stored in a private repository in ecr
- each time there is a commit on github, the pipeline is triggered and codebuild compiles the docker image.
- ecr is then configured to use the latest version of the image gotten from ecr.
Critical steps to remember: Congigure IAM roles for Codebuild Update Repon URI in buildspec.yml Expose ports in Security group for ecs to be accessible Take note of the branch you're commiting to.