blob: 909d17bdc1612d1a5f9164732efa38faf3ef14c0 [file] [log] [blame]
<!--
Copyright (c) 2006, 2019 IBM Corporation and others.
This program and the accompanying materials
are made available under the terms of the Eclipse Public License 2.0
which accompanies this distribution, and is available at
https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
IBM Corporation - initial API and implementation
-->
<project
name="upload"
default="upload"
basedir=".">
<!-- if not set by caller, assign default value. In this case, this must be
set before calling other property files, since it is a variable in those
property files -->
<property
name="site-sub-dir"
value="committers"/>
<!-- = = = 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"/>
<!-- = = = end standard properties pattern = = = -->
<!-- if not otherwise set, these are standard properties -->
<property
name="site-sub-dir"
value="committers"/>
<!-- upload is no longer used. If/when it is, uploadUser needs to be a real committer id -->
<property
name="uploadUser"
value="real-committer-id"/>
<property
name="uploadPassword"
value="This is not really used since ssh login is assumed (required)"/>
<property
name="uploadServer"
value="download1.eclipse.org"/>
<property
name="uploadRemoteDirectory"
value="/home/data/users/${uploadUser}/downloads/webtools/${site-sub-dir}/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="${wtp.builder.home}/scripts/build/label.xml"/>
<property file="${buildDirectory}/label.properties"/>
<echo
level="debug"
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>
<echo
level="info"
message="RSYNC to: ${uploadRemoteDirectory}/${buildLabel}"/>
<exec executable="ssh">
<arg line="${uploadUser}@${uploadServer} mkdir -p ${uploadRemoteDirectory}"/>
</exec>
<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="${env.BUILD_UPLOAD}"
arg2="true"
casesensitive="false"
trim="true"/>
</condition>
</target>
</project>