Created
August 25, 2021 15:01
-
-
Save cmaggiulli/ed15cb52c038268d497e56dd8841099b to your computer and use it in GitHub Desktop.
Sample file executing ssh commands in ant. Legacy deployment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- deploy --> | |
| <target name="deploy"> | |
| <echo message="Deploying ${tomcat.webapp} to ${tomcat.environment}" /> | |
| <for list="${tomcat.servers}" param="tomcat.server"> | |
| <sequential> | |
| <sshexec host="@{tomcat.server}" username="${user.name}" | |
| command="/u01/tomcat-sites/${tomcat.environment}/shutdown.sh" | |
| keyfile="${user.home}/.ssh/id_dsa" /> | |
| <sshexec host="@{tomcat.server}" username="${user.name}" | |
| command="rm -rf /u01/tomcat-sites/${tomcat.environment}/webapps/${tomcat.webapp}" | |
| keyfile="${user.home}/.ssh/id_dsa" /> | |
| <sshexec host="@{tomcat.server}" username="${user.name}" | |
| command="rm -rf /u01/tomcat-sites/${tomcat.environment}/work/Catalina/localhost/" | |
| keyfile="${user.home}/.ssh/id_dsa" /> | |
| <scp file="${deploy.root}/tomcat/${tomcat.webapp}.war" | |
| todir="${user.name}@@@{tomcat.server}:/u01/tomcat-sites/${tomcat.environment}/webapps/" | |
| passphrase="" keyfile="${user.home}/.ssh/id_dsa" /> | |
| <sshexec host="@{tomcat.server}" username="${user.name}" | |
| command="/u01/tomcat-sites/${tomcat.environment}/startup.sh" | |
| keyfile="${user.home}/.ssh/id_dsa" /> | |
| <sleep seconds="10" /> | |
| </sequential> | |
| </for> | |
| </target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment