Add upload-dist functionality

This commit is contained in:
Chris Beams
2010-07-28 16:23:10 +00:00
parent c4dd25c1c2
commit 72f9dadc69
3 changed files with 87 additions and 19 deletions

59
pom.xml
View File

@@ -31,22 +31,36 @@
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- dist.* properties are used by the antrun tasks below -->
<dist.id>spring-integration</dist.id>
<dist.name>Spring Integration</dist.name>
<dist.key>INT</dist.key>
<dist.version>${project.version}</dist.version>
<dist.releaseType>snapshot</dist.releaseType>
<dist.finalName>${dist.id}-${dist.version}</dist.finalName>
<dist.fileName>${dist.finalName}.zip</dist.fileName>
<dist.filePath>target/${dist.fileName}</dist.filePath>
<dist.bucketName>dist.springframework.org</dist.bucketName>
<!-- these properties should be in ~/.m2/settings.xml
<dist.accessKey>s3 access key</dist.accessKey>
<dist.secretKey>s3 secret key</dist.secretKey>
-->
</properties>
<profiles>
<profile>
<id>staging</id>
<distributionManagement>
<site>
<id>staging</id>
<url>file:///${java.io.tmpdir}/target/site</url>
<id>spring-site-staging</id>
<url>file:///${java.io.tmpdir}/spring-integration/docs/${project.version}</url>
</site>
<repository>
<id>staging</id>
<url>file:///${java.io.tmpdir}/target/repository</url>
<id>spring-milestone-staging</id>
<url>file:///${java.io.tmpdir}/spring-integration/milestone</url>
</repository>
<snapshotRepository>
<id>staging</id>
<url>file:///${java.io.tmpdir}/target/snapshotRepository</url>
<id>spring-snapshot-staging</id>
<url>file:///${java.io.tmpdir}/spring-integration/snapshot</url>
</snapshotRepository>
</distributionManagement>
</profile>
@@ -214,6 +228,39 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>upload-dist</id>
<phase>deploy</phase>
<configuration>
<tasks>
<ant antfile="${basedir}/src/ant/upload-dist.xml">
<target name="upload-dist"/>
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.springframework.build</groupId>
<artifactId>org.springframework.build.aws.ant</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>net.java.dev.jets3t</groupId>
<artifactId>jets3t</artifactId>
<version>0.7.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<repositories>

View File

@@ -45,36 +45,37 @@
<id>staging</id>
<distributionManagement>
<site>
<id>staging</id>
<url>file:///${java.io.tmpdir}/target/site</url>
<id>spring-site-staging</id>
<url>file:///${java.io.tmpdir}/spring-integration/docs/${project.version}</url>
</site>
<repository>
<id>staging</id>
<url>file:///${java.io.tmpdir}/target/repository</url>
<id>spring-milestone-staging</id>
<url>file:///${java.io.tmpdir}/spring-integration/milestone</url>
</repository>
<snapshotRepository>
<id>staging</id>
<url>file:///${java.io.tmpdir}/target/snapshotRepository</url>
<id>spring-snapshot-staging</id>
<url>file:///${java.io.tmpdir}/spring-integration/snapshot</url>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>
<distributionManagement>
<!-- see 'staging' profile for dry-run deployment settings -->
<downloadUrl>http://static.springframework.org/spring-integration/site/downloads/releases.html</downloadUrl>
<downloadUrl>http://www.springsource.com/download/community</downloadUrl>
<site>
<id>spring-docs</id>
<url>scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-integration/docs/${project.version}</url>
</site>
<repository>
<id>local</id>
<url>file://${java.io.tmpdir}/spring-integration-repo</url>
<id>spring-milestone</id>
<name>Spring Milestone Repository</name>
<url>s3://maven.springframework.org/milestone</url>
</repository>
<snapshotRepository>
<id>spring-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>s3://maven.springframework.org/snapshot</url>
</snapshotRepository>
<site>
<id>static.springframework.org</id>
<url>scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-integration/sites/${project.version}</url>
</site>
</distributionManagement>
<dependencyManagement><!--
inheritable <dependency> declarations for child poms. children still must

20
src/ant/upload-dist.xml Normal file
View File

@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<project name="upload-dist-tasks">
<taskdef resource="org/springframework/build/aws/ant/antlib.xml">
</taskdef>
<target name="upload-dist">
<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>
</project>