Testing CI/CD pipelines with AWS CodePipleline and Elastic Beanstalk

As you know, I am reading about AWS services and automate the deployment process of any AWS services terraform, ansible, PowerShell, and bash.

DevOps is one of the things right now in the term of CI/CD with the development and release of software in the DevOps process. Every development and the release of the software have to be as fast as possible.

So, In this tutorial, show you how the deployment and release of a web application agile as possible using Github, AWS CodePipeline, and AWS Elastic Beanstalk to create a deployment pipeline for a web application that is updated automatically every time you change your code (build and released).

let’s have a look at how you can do this step-by-step:
1. Create a deployment environment
2. Clone the code from GitHub repository
3. Create a CodePipeline
4. Test Web Application

1. Create a deployment environment
Elastic Beanstalk used to host web applications without the need to worry about the infrastructure, Elastic Beanstalk will take care of everything. I am going to deploy a PHP application on Elastic Beanstalk. So, create an environment for the PHP application.


Provide Application name as you want and select platform as PHP. 
Note: we are selecting the application code as a sample code. because we are going to push our original PHP code from Github repository later.
Once you have the environment, you can see the health check status and check the configurations of the environment. It will show the PHP configuration items you’ve selected during setup

2. Clone the code from GitHub repository
I have uploaded my sample PHP application which I am going to deploy on Elastic Beanstalk and along with that, I will configure CodePipeline.
The pipeline will take the source code from my GitHub repository and perform actions on it. If there is any change in the source code it will directly deploy that change to servers.

Note: There are three options for source code, GitHub repository, Amazon S3, or AWS CodeCommit repository. You can select one out of the three. For this particular case, I am going to use GitHub.

Find the repo here

3. Create a CodePipeline
AWS CodePipeline is a fully managed Continuous Delivery System that allows for easy and highly configurable methods for automating release pipelines. 
Provide Pipeline Name as you desired in my case hello-app-pipe and click next
Note: once you give it a name leave everything as it it is. No need to worry about Role name AWS creates an IAM role on the fly.


Go ahead and select the source as Github and then Connect Github option, click connect and select the repository and then, select Branch as Master. Click next. then skip build stages.
Note:  Every time you made changes in your code it kick off the pipeline.

Select deploy provider as Elastic Beanstalk. Under Application Name and Environment Name provide the name which you have given in EB Name.

Click Next and Create Pipeline.

4. Test Web Application
Now to the Elastic Beanstalk and check whether the code is deployed by clicking the test URL given in the EB environment.
Go to the repo and edit the index.html file and commit the changes to Github and again check the URL in which changes being deployed to our web Application.

, , , ,

No comments:

Post a Comment