Created
July 3, 2012 21:40
-
-
Save rmcfrazier/3043480 to your computer and use it in GitHub Desktop.
Ant builder to rsync on save in eclipse
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="Rsync On Save" basedir="." default="rsync"> | |
<description>Builder for eclipse to rsync on save for OSX.</description> | |
<!-- local source directory for rsync (read from this directory) --> | |
<property name="rsync.source.dir" value="${basedir}"/> | |
<!-- remote rsync host --> | |
<property name="rsync.destination.host" value="remote.example.com"/> | |
<!-- remote rsync directory (write to this directory) --> | |
<property name="rsync.destination.dir" value="/var/www/wp-content/plugins/rob-tester"/> | |
<!-- filepath to the ssh key--> | |
<property name="rsync.ssh.key" value="/Users/rmcfrazier/my-keys/remote.example.com.key"/> | |
<!-- ssh user to login to remote --> | |
<property name="rsync.ssh.user" value="ssh-user"/> | |
<target name="rsync"> | |
<echo message="Rsync source:"/> | |
<echo message="${rsync.source.dir}"/> | |
<echo message="Rsync destination:"/> | |
<echo message="${rsync.ssh.user}@${rsync.destination.host}:${rsync.destination.dir}"/> | |
<exec dir="." executable="rsync"> | |
<arg value="-arv"/> | |
<!-- exclude all hidden files and directories --> | |
<arg line="--exclude='.*'"/> | |
<!-- exclude build.xml and rsync.xml --> | |
<arg line="--exclude='build.xml'"/> | |
<arg line="--exclude='rsync.xml'"/> | |
<!-- variable that holds the filepath to the ssh key --> | |
<arg line="-e "ssh -i ${rsync.ssh.key}""/> | |
<!-- local directory that is the source for the rsync --> | |
<arg value="${rsync.source.dir}"/> | |
<!-- remote host and directory destination for rsync --> | |
<arg value="${rsync.ssh.user}@${rsync.destination.host}:${rsync.destination.dir}"/> | |
</exec> | |
</target> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please see my blog post for an explanation on how to use this eclipse ant-based builder.
http://blog.robert.mcfrazier.com/rsync-on-save-in-eclipse-on-osx/