-
Notifications
You must be signed in to change notification settings - Fork 0
CI CD documentation
CI/CD can be pictured as a pipeline, where new code is submitted on one end, tested over a series of stages (source, build, test, staging, and production), and then published as production-ready code.
Once logged in the user is now on the AWS management console.
Search for "Code Pipeline"
A pipeline is a workflow construct that describes how software changes go through a release process.
Each pipeline is made up of a series of stages. The AWS CodePipeline is a fully managed, continuous delivery service that helps automate release pipelines for fast and reliable application and infrastructure updates
There are 3 pipelines:
- test-api : Powerboard business API pipeline
- data-aggregator-service-first : Powerboard data aggregation service pipeline
- test1-webapp : Powerboard web app pipeline
test1-webapp
In the webapp there are 3 stages as described below:
Source
- In this stage an action is defined and action provider is selected here as GitHub version 2.
- A connection is established with GitHub.
- Next choose repository in GitHub account and then choose a branch
- Output artifact (any files to be built) from the previous step is ingested as an input artifact to the Build stage.
- Choose a name for the output artifacts
Build
- AWS CodeBuild is a fully managed build service in the cloud.
- CodeBuild compiles your source code, runs unit tests, and produces artifacts that are ready to deploy.
- A buildspec is a collection of build commands and related settings, in YAML format, that CodeBuild uses to run a build.
- Include a buildspec as part of the source code define a buildspec when you create a build project.
- Define build spec inside CodeBuild -> Build projects -> test-webapp-build as shown below
Deploy
-
Deployment stage contain a deployment action that deploys code to a compute service.
-
In Deploy provider, choose Amazon S3.
-
For Static website hosting we use S3 bucket
-
In the S3 permissions tab, the bucket policy is written in JSON. Include the following permissions:
- access to the objects stored in the bucket
- allow CORS: defines a way for client web applications that are loaded in one domain to interact with resources in a different domain
- access to the objects stored in the bucket
-
Since the bucket is configured as a static web site, the website link is available at Bucket website endpoint in the properties tab of the S3 bucket.
It consists of 2 stages as described below:
Source
- In this stage an action is defined and action provider is selected here as GitHub version 2.
- A connection is established with GitHub.
- Next choose repository in GitHub account and then choose a branch
- Output artifact (any files to be built) from the previous step is ingested as an input artifact to the Build stage.
Build
- Select the action provider as code build.
- Select input artifact as source artifact.
- Select build type as single build.
- Choose a name for output artifacts.
Deploy
- To prepare your application to run on Amazon ECS, you create a task definition.
-
Task Definition
- A task definition is required to run Docker containers in Amazon ECS.
- It can be thought of as a blueprint for your application.
- A task definition is a set of instructions that tells Amazon ECS how to run Docker containers. Task definitions are written in JSON or manually configured through the AWS Management Console.
-
Cluster
- Cluster is a logical grouping of tasks or services.
- Your tasks and services are run on infrastructure that is registered to a cluster.
- Create a cluster named test-api-cluster
- Cluster is a logical grouping of tasks or services.
- Used fargate as the launch type. Fargate is a better option for high performance.
-
Task : This is a running container with the settings defined in the Task Definition. It can be thought of as an “instance” of a Task Definition.
-
Service : Defines long running tasks of the same Task Definition. This can be 1 running container or multiple running containers all using the same Task Definition.
For credentials and account related information contact :[email protected]