简体   繁体   中英

How to deploy an application to EC2 instances(with Autoscaling) using Jenkins?

I have a Jenkins job and custom-built pipeline already functioning to deploy my Java application using Jboss to an EC2 server in AWS(by using the static IP of the instance). Now I plan to enable the Autoscaling feature for my EC2 instance.

What would be the best practices to make continuous deployments to these scaled EC2 instances maintaining the application's stability?

Here is the workflow I follow using Jenkins.

  • Create a Jenkins Pipeline that does a build and pushes to Amazon S3 - In an artifact bucket
  • Create a CodeDeploy application that deploys to the autoscaling group (not tag)
  • Create a CodePipeline application that polls for the S3 object, and when receved triggers CodeDeploy.

The great thing about CodeDeploy when attached to autoscaling groups is it creates a lifecycle hook . Whenever a new instance is deployed to the autoscaling group it will automatically deploy the latest version of code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM