We have already created VMs in AWS and Microsoft Azure in Chapter 4, Cloud Computing and Configuration Management. To deploy an application in AWS and Microsoft Azure VM, we need a WAR package file. Once it is created by the Jenkins build job, we need to perform the following steps:
Let's configure the build job to execute the deployment of the WAR file in the AWS instance by executing the commands shown as follows:
- Give rights to ec2-user in the webapps directory of Tomcat so we can copy the WAR file:
ssh -i /home/mitesh/book.pem -o StrictHostKeyChecking=no -t -t
[email protected] "sudousermod -a
-G tomcat ec2-user;
sudochmod -R g+w /var/lib/tomcat6/webapps; sudo service tomcat6
stop;"
- Copy the WAR file into the remote directory:
scp -i /home/mitesh...