Understanding the inside content of helper files (BuildSpec.yml, Dockerfile, and CF template)
In this recipe, we will see and understand what's there inside the helper files. We will analyze the flow of the BuildSpec.yml file and how it is basically creating image of the application and pushing it to ECR. Post that, we will understand Dockerfile. Then, we will understand how CloudFormation carries out its magic. Post that, we will update the helper files with our resource name.
How to do it...
The build stage of CodePipeline is integrated with CodeBuild, and here Codebuild is using BuildSpec.yml as the build command reference file. CodeBuild will pull the latest application code in the build environment, and then create an image of it. While creating image using Dockerfile it also builds the application using mvn. It means the build of application code takes place inside the Dockerfile only. Let's understand it in detail.
Here we have a BuildSpec.yml
file:
version: 0.2 env: variables: AWS_DEFAULT_REGION...