david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 1 | <project name="upload" default="upload" basedir="."> |
| 2 | |
| 3 | <!-- if site-sub-dir not set by caller, assume its committers --> |
| 4 | <property name="site-sub-dir" value="committers" /> |
| 5 | |
| 6 | <!-- = = = standard properties pattern = = = --> |
| 7 | <!-- |
| 8 | Note to be cross-platform, "environment variables" are only appropriate for |
| 9 | some variables, e.g. ones we set, since properties are case sensitive, even if |
| 10 | the environment variables on your operating system are not, e.g. it will |
| 11 | be ${env.Path} not ${env.PATH} on Windows --> |
| 12 | <property environment="env" /> |
| 13 | |
| 14 | <!-- |
| 15 | Let users override standard properties, if desired. |
| 16 | If directory, file, or some properties do not exist, |
| 17 | then standard properties will be used. |
| 18 | --> |
| 19 | <property file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" /> |
| 20 | |
| 21 | <!-- load standard properties for production environment --> |
| 22 | <property file="${env.STANDARD_PROPERTIES_DIR}/${ant.project.name}.properties" /> |
| 23 | <!-- = = = end standard properties pattern = = = --> |
| 24 | |
| 25 | |
| 26 | <!-- if not otherwise set, these are standard properties --> |
| 27 | <property name="build.upload" value="true" /> |
| 28 | |
| 29 | |
| 30 | <property name="uploadUser" value="david_williams" /> |
| 31 | <property name="uploadPassword" value="This is not really used since ssh login is assumed (required)" /> |
| 32 | <property name="uploadServer" value="download.eclipse.org" /> |
| 33 | <property name="uploadRemoteDirectory" value="/home/data/users/${uploadUser}/downloads/webtools/${site-sub-dir}/drops/${buildBranch}" /> |
| 34 | <!-- rsyncRootPrefix should be empty for Linux machines. --> |
| 35 | <!-- But, Windows using cygwin will need something like /cygdrive/G/ --> |
| 36 | <!-- for what ever drive or directory is parent of build home --> |
| 37 | <property name="rsyncRootPrefix" value="" /> |
| 38 | <!-- end standard properties --> |
| 39 | |
| 40 | |
| 41 | |
| 42 | <target name="upload" |
| 43 | depends="check.upload" |
| 44 | if="doUpload"> |
| 45 | |
| 46 | |
| 47 | |
| 48 | <ant antfile="${wtp.builder.home}/scripts/build/label.xml" /> |
| 49 | <property file="${buildDirectory}/label.properties" /> |
| 50 | |
| 51 | <echo message="chmod for ${buildDirectory}/${buildLabel}" /> |
| 52 | <!-- synch on host is a tiny bit faster if permisions already set --> |
| 53 | <!-- and, remember, chmod ant task is implemented only for unix --> |
| 54 | <!-- TODO: put in windows logic here? --> |
| 55 | <exec executable="chmod"> |
| 56 | <arg line="-Rc o+rx ${buildDirectory}/${buildLabel}" /> |
| 57 | </exec> |
| 58 | |
| 59 | <echo message="RSYNC to: ${uploadRemoteDirectory}/${buildLabel}" /> |
| 60 | |
| 61 | <exec executable="rsync"> |
david_williams | d93701b | 2006-11-29 03:31:07 +0000 | [diff] [blame^] | 62 | <arg line="-e ssh -Cavz ${rsyncRootPrefix}${buildDirectory}/${buildLabel} ${uploadUser}@${uploadServer}:${uploadRemoteDirectory}" /> |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 63 | </exec> |
| 64 | </target> |
| 65 | |
| 66 | <target name="check.upload"> |
| 67 | <condition property="doUpload"> |
| 68 | <equals arg1="${build.upload}" arg2="true" /> |
| 69 | </condition> |
| 70 | </target> |
| 71 | |
| 72 | </project> |