Create a ec2 instance and login to ec2 instance cerate folder and add some file to that folder and zip that folder
create second ec2 instance
create jenkins pipeline job and crete jenkins file and add the stage copy file from m1 to m2
for your own practice:
using ssh plugin in jenkins you can copy file from one machine to another machine
sshagent(['tomcatpem']) {
sh "scp -o StrictHostKeyChecking=no target/RentalCars.war ubuntu@${ip_address}:/home/ec2-user/apache-tomcat-9.0.63/webapps"
}
sshagent(['tomcatpem']) { sh "scp -o StrictHostKeyChecking=no target/RentalCars.war ubuntu@${ip_address}:/home/ec2-user/apache-tomcat-9.0.63/webapps" }