blob: cfb895682c0884bbc7d681a8934716126a6a5075 [file] [log] [blame]
<project name="upload" default="upload" basedir=".">
<!-- if site-sub-dir not set by caller, assume its committers -->
<property name="site-sub-dir" value="staging" />
<!-- = = = standard properties pattern = = = -->
<!--
Note to be cross-platform, "environment variables" are only appropriate for
some variables, e.g. ones we set, since properties are case sensitive, even if
the environment variables on your operating system are not, e.g. it will
be ${env.Path} not ${env.PATH} on Windows -->
<property environment="env" />
<!--
Let users override standard properties, if desired.
If directory, file, or some properties do not exist,
then standard properties will be used.
-->
<property file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" />
<!-- load standard properties for production environment -->
<property file="${env.STANDARD_PROPERTIES_DIR}/${ant.project.name}.properties" />
<!-- = = = end standard properties pattern = = = -->
<!-- if not otherwise set, these are standard properties -->
<property name="build.upload" value="true" />
<property name="uploadUser" value="releng" />
<property name="uploadPassword" value="This is not really used since ssh login is assumed (required)" />
<property name="uploadServer" value="localhost" />
<property name="uploadRemoteDirectory" value="/media/slider/builds/dltk/staging/drops/${buildBranch}" />
<!-- rsyncRootPrefix should be empty for Linux machines. -->
<!-- But, Windows using cygwin will need something like /cygdrive/G/ -->
<!-- for what ever drive or directory is parent of build home -->
<property name="rsyncRootPrefix" value="" />
<!-- end standard properties -->
<target name="upload" depends="check.upload" if="doUpload">
<ant antfile="${dltk.builder.home}/scripts/build/label.xml" />
<property file="${buildDirectory}/label.properties" />
<copy todir="${uploadRemoteDirectory}/${buildLabel}">
<fileset dir="${rsyncRootPrefix}${buildDirectory}/${buildLabel}" />
</copy>
<!--echo message="chmod for ${buildDirectory}/${buildLabel}" /-->
<!-- synch on host is a tiny bit faster if permisions already set -->
<!-- and, remember, chmod ant task is implemented only for unix -->
<!-- TODO: put in windows logic here? -->
<!--exec executable="chmod">
<arg line="-Rc o+rx ${buildDirectory}/${buildLabel}" />
</exec-->
<!--exec executable="sudo">
<arg line="chmod -R g+w ${uploadRemoteDirectory}/${buildLabel}" />
</exec>
<exec executable="sudo">
<arg line="chown -R devteam:devteam ${uploadRemoteDirectory}/${buildLabel}" />
</exec-->
<!--echo message="RSYNC to: ${uploadRemoteDirectory}/${buildLabel}" /-->
<!--exec executable="rsync">
<arg line="-e ssh -Cavz ${rsyncRootPrefix}${buildDirectory}/${buildLabel} ${uploadUser}@${uploadServer}:${uploadRemoteDirectory}" />
</exec-->
</target>
<target name="check.upload">
<condition property="doUpload">
<equals arg1="${build.upload}" arg2="true" />
</condition>
</target>
</project>