Created
September 29, 2011 15:02
-
-
Save fordnox/1250916 to your computer and use it in GitHub Desktop.
Ant target to push source to staging server
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
<target name="stage" depends="build-source"> | |
<property name="remote.user" value="username" /> | |
<property name="remote.address" value="hostname" /> | |
<property name="remote.path" value="~/v_${version}" /> | |
<property name="remote.shared_path" value="~/v_shared" /> | |
<echo message="Deploying project ${ant.project.name} source ${source} to server ${remote.address} ${remote.path}" /> | |
<exec dir="." executable="rsync" failonerror="true"> | |
<arg line="-avPe ssh ${source}/ ${remote.user}@${remote.address}:${remote.path}" /> | |
</exec> | |
<exec dir="." executable="ssh" failonerror="true"> | |
<arg line="-p22 -l ${remote.user} -q -t ${remote.address} 'rm -rf ~/v_current ; ln -sf ${remote.path} ~/v_current ; ln -sf ${remote.shared_path} ${remote.path}/shared'" /> | |
</exec> | |
</target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment