It is been a while since I last caught up in this COVID-19 pandemic. π« This time I am bringing how to automate your spring boot app deployment on AWS. In this article I am deriving how to configure AWS CodePipeline to deploy a spring boot application from GitHub to an AWS Elastic Beanstalk instance πͺ In order to continue this article, you will have to follow my previous articles i.e.
I will be continuing from those articles and if you are not familiar with either spring boot or AWS Elastic BeanStalk, I do recommend you to follow them.
First of all, letβs get to know what is the automation of code deployment. It is simply called as CI / CD i.e. Continuous Integration and Continuous Delivery and Deployment. As nowadays the Agile approach is used, features have to be delivered in every 2 to 3 weeks. That will make the client happy as well as everything would get sorted π In those instances you will have to deploy your code to the server every now and then. It is a difficult task. Then it comes the advantage of using ci/cd β€. You simply have to commit your changes and the ci/cd configuration will automatically test your code and deploy it to the server πͺ
Now letβs move on to the example I am going to describe. In this example, source code is in GitHub and once we commit a change, it will trigger a hook to AWS infrastructure. Then the build is going to be done using AWS CodeBuild. Build is defined using _buildspec.yml _which I will show later. After source code is built, artifacts are uploaded to an S3 bucket. There is a feature called AWS CodeDeploy which deploys the artifacts in the S3 bucket to the Elastic BeanStalk instance. This whole process is controlled using a service called AWS CodePipelines.
Now I am going to use my initial project, which I mentioned earlier. In addition to that, I am going to create a GitHub repository and commit and push my code into it.
Create new repo in GitHub
#ci-cd-pipeline #spring-boot #github #java #aws