Skip to content

Instantly share code, notes, and snippets.

@apzentral
Last active April 11, 2023 18:00
Show Gist options
  • Save apzentral/820462b4661ea33a6ba6716e36875129 to your computer and use it in GitHub Desktop.
Save apzentral/820462b4661ea33a6ba6716e36875129 to your computer and use it in GitHub Desktop.
ANT: sshexec template
<!-- Build Script for ANT -->
<project basedir="." default="" name="Build Script">
<property name="username" value="username"/>
<property name="passwd" value="passwd"/>
<property name="keyfile-path" value="/path-to-private-key"/>
<property name="applicationFolder" value="/var/www/html/"/>
<property name="sandboxRoot" value="${basedir}"/>
<property name="development-server" value="server"/>
<property name="production-server" value="server"/>
<!-- Development -->
<target description="Execute Command to Development Server: ${development-server}" name="exec-development">
<echo message="--- Start execute command to the Development Server - ${development-server} ---"/>
<sshexec host="${development-server}"
keyfile="${keyfile-path}"
trust="true"
username="${username}"
password="${passwd}"
command="command to execute"/>
<echo message="--- Done ---"/>
</target>
<!-- Production -->
<target description="Execute Command to Production Server: ${production-server}" name="exec-production">
<echo message="--- Start execute command to the Production Server - ${production-server} ---"/>
<sshexec host="${production-server}"
keyfile="${keyfile-path}"
trust="true"
username="${username}"
password="${passwd}"
command="command to execute"/>
<echo message="--- Done ---"/>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment