views:

68

answers:

1

In the following ant build.xml snippet, I am performing an rsync operation. The rsync command prompts for a password.

The problem is, when it prompts for the password, I enter it once, hit enter, and nothing happens. So I type it again (second time) and hit enter, then it works.

It's strange to me that I have to enter it twice and I don't understand why?

<!-- Define a target which publishes the final build apk to the test server. -->
<target name="upload" depends="release">
        <exec executable="rsync" dir="${basedir}">
                <arg value="--stats"/>
                <arg value="--progress"/>
                <arg value="-vaz"/>
                <arg value="bin/myfile.apk"/>
                <arg value="root@target:/path/to/backupfolder"/>
        </exec>
</target>
A: 

Maybe some environment variables values already set in the shell are not accessable in the ant script, eg. RSYNC_RSH, RSYNC_PASSWORD. You can set those variables/values via the corresponding options like -e or --password-file, or set those variables inside the task via the env element of ant.

Michael Konietzka
I want it to prompt me for authentication so I haven't defined a preshared key using -e or defined RSYNC_PASSWORD. Doing either of those would certainly dodge the problem but I like the security of entering the password for the upload...
Brad Hein