Search code examples
jenkinsjenkins-pipelinejenkins-pluginstomcat7devops-services

How to deploy war file to aws ec2 instances placed in auto scaling groups


How to copy .war file of tomcat 7 and 8 to EC2 instances placed in auto scaling group without any downtime. I want to replace the existing .war file with latest one in each and every servers in the target group/scaling group. How to configure my Jenkins for this.

Thank you


Solution

  • Once they are in an auto-scaling group, you will not be able to modify files directly on the server. Changing something on one server will not be mirrored on the other servers, and even if you changed all the currently running servers manually, those changes will not be rendered by any servers implemented by auto-scaling actions.

    This can be solved by many methods, such as using "AWS Code Deploy."

    You may also be able to configure something in your auto-scaling configuration via an "EC2 User-Data script" that will run on each server when it is created. That script could check out Git's latest code, or pull S3's latest build artifact and then launch the app.

    You will simply mark the current instances as "unhealthy" when you have an upgrade ready to deploy and wait for the "Auto-Scaling" community to replace them with new, modified instances automatically.