Over the past few years Continuous Integration, Continuous Delivery and Continuous Deployment have been a part of daily software vocabulary. What does it really mean, and what is the difference between continuous delivery, continuous deployment and continuous integration? Keep reading for some perspective.
Create a source bundle, which includes the deployment scripts, and upload it to AWS CodeCommit repository
Now you can download the following sample bundle to your local repository and push the change to the central repository along with your application code hosted on AWS CodeCommit. The sample bundle includes everything you need to work AWS CodeDeploy: the Application Specification (AppSpec) file and deployment scripts.
Use AWS CodeDeploy to Deploy Amazon EC2 Instances Behind an Elastic Load Balancer and Auto Scaling
Let’s assume you have an application architecture designed for high availability that includes an Elastic Load Balancer in front of multiple application servers belonging to an Auto Scaling Group. Elastic Load Balancing enables you to distribute incoming traffic over multiple servers and Auto Scaling allows you to scale your EC2 capacity up or down automatically according to your needs In this blog post, we will show how you can use CodeDeploy to avoid downtime when updating the code running on your application servers in such an environment. We will use the CodeDeploy rolling updates feature so that there is a minimum capacity always available to serve traffic and use a simple script to take EC2 instances out of the load balancer as and when we deploy new code on it.
AWS CodeDeploy coordinates application deployments to Amazon EC2 instances, on-premises instances, or both. (On-premises instances are physical devices that are not Amazon EC2 instances.)
An application can contain deployable content like code, web, and configuration files, executables, packages, scripts, and so on. AWS CodeDeploy deploys applications from Amazon S3 buckets and GitHub repositories.
You do not need to make changes to your existing code to use AWS CodeDeploy. You can use AWS CodeDeploy to control the pace of deployment across Amazon EC2 instances and to define the actions to be taken at each stage. AWS CodeDeploy works with various systems for configuration management, source control, continuous integration, continuous delivery, and continuous deployment.
Jenkins is an open source automation server. With Jenkins, organizations can accelerate the software development process through automation. Jenkins manages and controls development lifecycle processes of all kinds, including build, document, test, package, stage, deployment, static analysis and many more.
You can set up Jenkins to watch for any code changes in places like SVN and Git, automatically do a build with tools like Ant and Maven, initiate tests and then take actions like rolling back or rolling forward in production.
Set Up the Jenkins Server
Create an instance using the Amazon Linux AMI. Make sure you associate the instance with the CodeCommitRole role (Created in previous step) and configure the security group associated with the instance to allow incoming traffic on ports 22 (SSH) and 8080 (Jenkins). You may further secure your server by restricting access to only the IP addresses of local development environment connecting to Jenkins