david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 1 | <project |
| 2 | name="upload" |
| 3 | default="upload" |
| 4 | basedir="."> |
| 5 | |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 6 | <!-- = = = standard properties pattern = = = --> |
| 7 | <!-- |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 8 | Note to be cross-platform, "environment variables" are only appropriate for |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 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" /> |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 13 | |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 14 | <!-- |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 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 |
| 20 | file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" /> |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 21 | |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 22 | <!-- = = = end standard properties pattern = = = --> |
| 23 | |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 24 | |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 25 | <!-- if not otherwise set, these are standard properties --> |
david_williams | 954def2 | 2007-12-12 15:21:29 +0000 | [diff] [blame^] | 26 | |
| 27 | <property |
| 28 | name="site-sub-dir" |
| 29 | value="committers" /> |
| 30 | |
david_williams | 536b595 | 2007-12-09 06:03:17 +0000 | [diff] [blame] | 31 | |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 32 | <property |
| 33 | name="uploadUser" |
| 34 | value="david_williams" /> |
| 35 | <property |
| 36 | name="uploadPassword" |
| 37 | value="This is not really used since ssh login is assumed (required)" /> |
| 38 | <property |
| 39 | name="uploadServer" |
| 40 | value="download.eclipse.org" /> |
| 41 | <property |
| 42 | name="uploadRemoteDirectory" |
| 43 | value="/home/data/users/${uploadUser}/downloads/webtools/${site-sub-dir}/drops/${buildBranch}" /> |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 44 | <!-- rsyncRootPrefix should be empty for Linux machines. --> |
| 45 | <!-- But, Windows using cygwin will need something like /cygdrive/G/ --> |
| 46 | <!-- for what ever drive or directory is parent of build home --> |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 47 | <property |
| 48 | name="rsyncRootPrefix" |
| 49 | value="" /> |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 50 | <!-- end standard properties --> |
| 51 | |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 52 | |
| 53 | |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 54 | <target |
| 55 | name="upload" |
| 56 | depends="check.upload" |
| 57 | if="doUpload"> |
| 58 | |
| 59 | |
| 60 | |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 61 | <ant antfile="${wtp.builder.home}/scripts/build/label.xml" /> |
| 62 | <property file="${buildDirectory}/label.properties" /> |
| 63 | |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 64 | <echo |
| 65 | level="debug" |
| 66 | message="chmod for ${buildDirectory}/${buildLabel}" /> |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 67 | <!-- synch on host is a tiny bit faster if permisions already set --> |
| 68 | <!-- and, remember, chmod ant task is implemented only for unix --> |
| 69 | <!-- TODO: put in windows logic here? --> |
| 70 | <exec executable="chmod"> |
| 71 | <arg line="-Rc o+rx ${buildDirectory}/${buildLabel}" /> |
| 72 | </exec> |
| 73 | |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 74 | <echo |
| 75 | level="info" |
| 76 | message="RSYNC to: ${uploadRemoteDirectory}/${buildLabel}" /> |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 77 | |
| 78 | <exec executable="rsync"> |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 79 | <arg |
| 80 | line="-e ssh -Cavz ${rsyncRootPrefix}${buildDirectory}/${buildLabel} ${uploadUser}@${uploadServer}:${uploadRemoteDirectory}" /> |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 81 | </exec> |
| 82 | </target> |
| 83 | |
| 84 | <target name="check.upload"> |
| 85 | <condition property="doUpload"> |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 86 | <equals |
david_williams | 536b595 | 2007-12-09 06:03:17 +0000 | [diff] [blame] | 87 | arg1="${env.BUILD_UPLOAD}" |
david_williams | 954def2 | 2007-12-12 15:21:29 +0000 | [diff] [blame^] | 88 | arg2="true" |
| 89 | casesensitive="false" |
| 90 | trim="true"/> |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 91 | </condition> |
| 92 | </target> |
| 93 | |
| 94 | </project> |