This repository has been archived by the owner on Mar 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 315
/
upload-dist.xml
65 lines (62 loc) · 3.18 KB
/
upload-dist.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?xml version="1.0"?>
<project name="upload-dist-tasks">
<!-- can be run independent of maven as follows (but it's easier
to simply use "mvn antrun:run"):
- classpath must be uncommented below. when run from maven,
- the classpath is set up for you
ant -f src/ant/upload-dist.xml \
-Ddist.id=spring-batch-admin \
-Ddist.name='Spring Batch Admin' \
-Ddist.key=BATCHADM \
-Ddist.accessKey=<access key> \
-Ddist.secretKey=<secret key> \
-Ddist.bucketName=dist.springframework.org \
-Ddist.fileName=spring-batch-admin-1.0.0.M1.zip \
-Ddist.filePath=../../spring-batch-admin-1.0.0.M1.zip \
-Ddist.version=1.0.0.M1 \
upload-dist
-->
<taskdef resource="org/springframework/build/aws/ant/antlib.xml">
<!-- see comment above
<classpath>
<pathelement location="/Users/cbeams/Desktop/org.springframework.build.aws.ant-3.0.5.RELEASE.jar"/>
<pathelement location="/Users/cbeams/.m2/repository/net/java/dev/jets3t/jets3t/0.7.2/jets3t-0.7.2.jar"/>
<pathelement location="/Users/cbeams/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
<pathelement location="/Users/cbeams/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
<pathelement location="/Users/cbeams/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar"/>
</classpath>
-->
</taskdef>
<target name="upload-dist" depends="upload-prep,upload-s3,upload-staging"/>
<target name="upload-prep">
<condition property="dist.releaseType" value="snapshot">
<contains string="${dist.version}" substring="snapshot" casesensitive="false"/>
</condition>
<condition property="dist.releaseType" value="release" else="milestone">
<contains string="${dist.version}" substring="release" casesensitive="false"/>
</condition>
</target>
<target name="upload-s3" unless="dist.staging">
<checksum file="${dist.filePath}" algorithm="sha1"/>
<s3 accessKey="${dist.accessKey}" secretKey="${dist.secretKey}">
<upload bucketName="${dist.bucketName}" file="${dist.filePath}"
toFile="${dist.releaseType}/${dist.key}/${dist.fileName}" publicRead="true">
<metadata name="project.name" value="${dist.name}"/>
<metadata name="release.type" value="${dist.releaseType}"/>
<metadata name="bundle.version" value="${dist.version}"/>
<metadata name="package.file.name" value="${dist.fileName}"/>
</upload>
<upload bucketName="${dist.bucketName}" file="${dist.filePath}.sha1"
toFile="${dist.releaseType}/${dist.key}/${dist.fileName}.sha1" publicRead="true">
</upload>
</s3>
</target>
<target name="upload-staging" if="dist.staging">
<echo>Copying dist .ZIP to ${dist.staging}</echo>
<checksum file="${dist.filePath}" algorithm="sha1"/>
<copy file="${dist.filePath}.sha1"
toFile="${dist.staging}/${dist.key}/${dist.fileName}.sha1"/>
<copy file="${dist.filePath}"
toFile="${dist.staging}/${dist.key}/${dist.fileName}"/>
</target>
</project>