In today's rapidly growing world, applications are also required to grow rapidly in order to meet end user expectations. To achieve agility, constant innovation, and faster time to market, it is essential to implement Continuous Integration/Continuous Deployment (CI/CD) in order to deploy rapidly changing application code and to avoid any errors that may be caused manually. AWS CodePipeline plays an important role here: it acts as a fast and reliable continuous delivery service in the DevOps era. It automates the steps that are required to fetch new code from a source code repository (such as Git or CodeCommit) in order to build it and make it ready for deployment through the software release process. The software release process first entails deploying code to the development environment, then to the testing environment in order to conduct various...
You're reading from AWS Certified Developer - Associate Guide - Second Edition
Introducing CodePipeline and workflows
AWS CodePipeline is able to release new features or bug fixes more frequently by atomizing builds. It performs tests and makes code ready to be deployed to various environments. It can be configured using the AWS CodePipeline web console or a CLI. A workflow defines the various steps in a software release process and it can be customized as per an enterprise's requirements. The workflow briefly instructs AWS CodePipeline on how new code changes will progress through each stage of the release process, including how and where the newly modified code should be built, tested, and deployed.
Every code change made to the source code repository is automatically pushed through the set of actions defined in the workflow (or pipeline). This is to make the modified code run through a standardized process after every commit. Optionally, Amazon CodePipeline...
AWS CodePipeline usages
In general, AWS CodePipeline can be used to automatically build, test, and deploy applications from the source code repository in order to build, test, and deploy applications in various environments. In a broader sense, AWS CodePipeline is useful in the following scenarios:
- To automate a consistent release process: A consistent set of steps can be defined and carried out every time a code change occurs. Amazon CodePipeline executes each stage of a release automatically according to the defined criteria.
- To speed up delivery while improving quality: All the steps of a release process are clearly specified and carried out automatically, which speeds up the new release process.
AWS CodePipeline – a higher-level view
The following diagram is useful for gaining an understanding of the release process using Amazon CodePipeline at a very high level:
The various steps of the preceding diagram can be explained as follows:
- Source: The release process cycle begins as soon as developers commit a change to the source code repository.
- Build: CodePipeline promptly and automatically identifies changes in the source code repository. It can perform the configured code quality tests. Once the code passes the tests, it builds the code and then compiles it.
- Staging: The recently built code is deployed to the staging environment in order to carry out tests such as integration and load tests.
- Manual Approval: In contrast with continuous deployment, in continuous delivery, the final stage for deploying the code (that is, the build stage) to production requires...
AWS CodePipeline concepts
In order to work effectively and efficiently with AWS CodePipeline, it is essential to understand some of the concepts and terms that are used with a pipeline.
CI with AWS CodePipeline
It is a common software development practice for each developer in a team to frequently commit their application code into the respective branches of the centralized source code repository. For example, a group of developers or an individual developer working on a bug fix will commit code into a specific bug fix branch. The purpose of this software development methodology is to identify a bug at an early stage. A bug can become quite obvious when several developers are working on the same part of the application development...
Working with CodePipeline
AWS CodePipeline automates and manages the release process workflow through the use of pipelines. A pipeline is simply a workflow that defines how software changes should take place during a release process. The following diagram is useful for understanding the concepts of pipelines:
The various steps of the preceding diagram can be explained as follows:
- A pipeline in AWS CodePipeline can be created using a web console, SDKs, or a CLI. At the same time, we can define a default or a custom Amazon S3 bucket to use as an artifact store. This is created in the same region as the pipeline is created in. When a default Amazon S3 bucket is selected to use as an artifact store, the naming convention is codepipeline-region-123456789EXAMPLE, where region is the actual AWS region in which the pipeline is being created. For every pipeline, an individual folder...
Summary
CodePipeline facilitates continuous deployment on AWS. It can be used to automate the software deployment process, allowing a developer to quickly model, visualize, and deliver code for new feature updates. This chapter introduced you to CodePipeline and explained how you can use it in your development projects.
In the next chapter, we will come to understand the CI/CD mechanism in AWS.