Introduction to Software Releases, Builds and Code Pipelines

Overview

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Have you ever wondered what a software release life cycle is? Today we’re going to take an in-depth look at Software release cycles and AWS DevOps Solutions to help you refine and automate your software releases.

The basic description of a software release cycle is “the sum of the stages of development and maturity for a piece of computer software.”

Build vs Release

A “build” is (usually) a piece of custom software or an application that has been developed. Once the build is complete, it goes from the development team to the software testing team.

A “release” is the official launch of the application. A build, when tested and certified by the software testing team, is provided to the customers as a “release”.

Code Pipelines

A code, or deployment, pipeline is the process of taking code from version control and making it readily available to users of the application in an automated fashion. This allows a team of developers working on projects or features to reliably, efficiently and consistently build, test and deploy their work

Continuous Integration or CICD

When we as developers talk about CI/CD or CICD, we are talking about continuous integration and either continuous delivery or continuous deployment.
Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early. By integrating regularly, you can detect and locate errors faster and easier.
CICD is a development practise where code changes are automatically prepared for a release to production. CICD expands upon continuous integration by deploying all code changes to a QA environment and/or a production environment after the build stage. When properly implemented, developers will always have a deployment-ready build.
Continuous delivery lets developers like Silicon Overdrive automate testing beyond unit tests so we can verify application updates across multiple dimensions before deploying to your production environment.
Our testing encompasses UI testing, load testing, integration testing, API reliability testing, and more. This process helps us thoroughly validate updates and pre-emptively discover issues.
With AWS, it is easy for us to automate the creation and replication of multiple environments for testing, which was previously difficult to do on-site.
With continuous delivery, every code change is built, tested, and then pushed to a QA or staging environment. There can be multiple, parallel test stages before a production deployment.
The difference between continuous delivery and continuous deployment is the presence of a manual approval to update to production. With continuous deployment, production happens automatically without explicit approval.
CICD often bridges the gap between development and operations teams by automating the building, testing, and deployment of applications.

Introduction to AWS Services Used in DevOps

Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform, offering over 165 fully featured services from data centres globally. The AWS Cloud spans 69 Availability Zones within 22 geographic Regions around the world, with announced plans for 16 more Availability Zones and 5 more Regions in Indonesia, Cape Town, Italy, Japan and Spain.

Each AWS Region is a separate geographic area. Each AWS Region has multiple, isolated locations known as Availability Zones. Resources aren’t replicated across AWS Regions unless you do so specifically.

The AWS global infrastructure is designed and built to deliver the most flexible, reliable, scalable, and secure cloud computing environment with the highest quality global network performance available today. Every component of the AWS infrastructure is design and built for redundancy and reliability, from regions to networking links to load balancers to routers and firmware.

AWS CodeCommit

AWS CodeCommit is a fully-managed source control service that hosts secure Git-based repositories. It makes it easy for teams to collaborate on code in a secure and highly scalable ecosystem. CodeCommit eliminates the need to operate your own source control system or worry about scaling its infrastructure. You can use CodeCommit to securely store anything from source code to binaries, and it works seamlessly with your existing Git tools.

AWS CodeBuild

AWS CodeBuild is a fully managed continuous integration service that compiles source code, runs tests, and produces software packages that are ready to deploy. With CodeBuild, you don’t need to provision, manage, and scale your own build servers. CodeBuild scales continuously and processes multiple builds concurrently, so your builds are not left waiting in a queue. You can get started quickly by using pre-packaged build environments, or you can create custom build environments that use your own build tools. With CodeBuild, you are charged by the minute for the compute resources you use.

AWS CodeDeploy

AWS CodeDeploy is a fully managed deployment service that automates software deployments to a variety of compute services such as Amazon EC2, AWS Fargate, AWS Lambda, and your on-premises servers. AWS CodeDeploy makes it easier for you to rapidly release new features, helps you avoid downtime during application deployment, and handles the complexity of updating your applications. You can use AWS CodeDeploy to automate software deployments, eliminating the need for error-prone manual operations. The service scales to match your deployment needs.

AWS CodePipeline

AWS CodePipeline is a fully managed continuous delivery service that helps you automate your release pipelines for fast and reliable application and infrastructure updates. CodePipeline automates the build, test, and deploy phases of your release process every time there is a code change, based on the release model you define.
This enables you to rapidly and reliably deliver features and updates. You can easily integrate AWS CodePipeline with third-party services such as GitHub or with your own custom plugin. With AWS CodePipeline, you only pay for what you use. There are no upfront fees or long-term commitments.

AWS CodeStar

AWS CodeStar enables you to quickly develop, build, and deploy applications on AWS. AWS CodeStar provides a unified user interface, enabling you to easily manage your software development activities in one place. With AWS CodeStar, you can set up your entire continuous delivery toolchain in minutes, allowing you to start releasing code faster.

AWS CodeStar makes it easy for your whole team to work together securely, allowing you to easily manage access and add owners, contributors, and viewers to your projects. Each AWS CodeStar project comes with a project management dashboard, including an integrated issue tracking capability powered by Atlassian JIRA Software. With the AWS CodeStar project dashboard, you can easily track progress across your entire software development process, from your backlog of work items to teams’ recent code deployments.

AWS Elastic Beanstalk

AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker on familiar servers such as Apache, Nginx, Passenger, and IIS.

You can simply upload your code and Elastic Beanstalk automatically handles the deployment, from capacity provisioning, load balancing, auto-scaling to application health monitoring. At the same time, you retain full control over the AWS resources powering your application and can access the underlying resources at any time.
There is no additional charge for Elastic Beanstalk – you pay only for the AWS resources needed to store and run your applications.

CICD Recommendations

Different combinations of AWS services and products can achieve a CICD pipeline; depending on your needs.
There are many ways to setup CICD pipelines, depending on the development team and preferences.

1) Using a Git Repository with AWS CodeDeploy

Git Repository

If CodeBuild is Required

1. Select AWS CodeBuild as Build provider
2. Select Project name as the build project created

This will be triggered from the hooks section in the appspec.yml and will perform BeforeInstall, ApplicationStop and ApplicationStart tasks during deploy.

  • Add codedeploy_deploy.py to repository root
This performs the deployment process and will control the downloading of the artifact from the S3 bucket, extracting the code and updating the destination.
  • Add appspec.yml to repository root

This controls the deployment destinations and permisions as well as the hooks for BeforeInstall, ApplicationStop and ApplicationStart operations

  • Using Bitbucket
  • In Bitbucket enable the Pipelines under the Bitbucket settings https://confluence.atlassian.com/bitbucket/get-started-with-bitbucket-pipelines-792298921.html
  • Under the Repository variables in Pipelines options configure the following variables that will be required to trigger the CodeDeploy
  • ZIP_FILE – Name of the artifact (zip file) that will be created by the Github
  • DEPLOYMENT_CONFIG – The deployment config that was used in the CodeDeploy configuration
    AWS_ACCESS_KEY_ID –
  • The Access key ID of the user configured in IAM
  • AWS_SECRET_ACCESS_KEY – the Secret access key of the user configured in the IAM
  • AWS_DEFAULT_REGION – The AWS region used for the deployment
  • S3_BUCKET – The S3 bucket where the artifact will be placed after it is created by Bitbucket
  • APPLICATION_NAME – The Application name for the deployment configured in CodeDeploy
  • DEPLOYMENT_GROUP_NAME – The Deployment group for the deployment configured in CodeDeploy
  • Add deployment scripts (scripts directory) to repository root.

This will be triggered from the hooks section in the appspec.yml and will perform BeforeInstall, ApplicationStop and ApplicationStart tasks during deploy.

  • Add codedeploy_deploy.py to repository root
This performs the deployment process and will control the downloading of the artifact from the S3 bucket, extracting the code and updating the destination.
  • Add appspec.yml to repository root

This controls the deployment destinations and permisions as well as the hooks for BeforeInstall, ApplicationStop and ApplicationStart operations

  • Add bitbucket-pipelines.yml to repository root

This controls the branch that are being pushed and the task to be performed in Bitbucket for the branch, i.e. fetch the environment variables, compress the code into an artifact and then run the codedeploy_deploy.py

If CodeBuild is Not Required

  • If CodeBuild is required
  • Configure CodeBuild for your Git repository (AWS CodeCommit, Bitbucket or GitHub) https://docs.aws.amazon.com/codebuild/latest/userguide/create-project.html
  • During the CodePipeline setup build stage https://docs.aws.amazon.com/codebuild/latest/userguide/how-to-create-pipeline.html
  • Select AWS CodeBuild as Build provider
  • Select Project name as the build project created

Glossary

Word – This is the definition.

Word – This is the definition.

Word – This is the definition.

Word – This is the definition.

If you liked this, you'll love these...

What is AWS DevOps
AWS Blog

What is DevOps?

When we talk about DevOps, we mean an approach to IT delivery that combines people and tools that can help break down silos between development and operations teams.