blob: 262a855159d3cfa9877cb77ed64e707246474e45 [file] [log] [blame]
<?xml version="1.0"?>
<!-- -->
<!-- Copyright (c) 2008 Cisco Systems, Inc. -->
<!-- All rights reserved. This program and the accompanying materials -->
<!-- are made available under the terms of the Eclipse Public License v1.0 -->
<!-- which accompanies this distribution, and is available at -->
<!-- http://www.eclipse.org/legal/epl-v10.html -->
<!-- -->
<!-- Contributors: -->
<!-- Cisco Systems, Inc. - erdillon -->
<!-- -->
<!-- Deploys a build to either downloads site or Updates site -->
<!-- This bit allows to include the taskdefs conveniently -->
<project name="Deploy build">
<!-- Include task defs for Releng Ant extensions -->
<path id="downloadsite.ant.path">
<fileset dir="${libs}">
<include name="**/*.jar" />
</fileset>
</path>
<taskdef classname="org.eclipse.tigerstripe.releng.downloadsite.ant.NewBuild" name="dsite.newBuild" classpathref="downloadsite.ant.path">
</taskdef>
<taskdef classname="org.eclipse.tigerstripe.releng.downloadsite.ant.MergeBuild" name="dsite.mergeBuild" classpathref="downloadsite.ant.path">
</taskdef>
<taskdef classname="org.eclipse.tigerstripe.releng.downloadsite.ant.AddComponent" name="dsite.addComponent" classpathref="downloadsite.ant.path">
</taskdef>
<taskdef classname="org.eclipse.tigerstripe.releng.downloadsite.ant.AddDependency" name="dsite.addDependency" classpathref="downloadsite.ant.path">
</taskdef>
<taskdef classname="org.eclipse.tigerstripe.releng.downloadsite.ant.AddDetail" name="dsite.addDetail" classpathref="downloadsite.ant.path">
</taskdef>
<taskdef classname="org.eclipse.tigerstripe.releng.downloadsite.ant.UpdateNotesDetails" name="dsite.addReleaseNotes" classpathref="downloadsite.ant.path">
</taskdef>
<property file="../bootstrap.properties" />
<property file="../build.properties" />
<property file="../local.properties" />
<property file="${login.properties}" />
<property file="${downloads.site.details}" />
<property file="${update.site.details}" />
<property name="download.site" value="${download.site.username}@${download.site.host}:${download.site.directory}" />
<property name="update.site" value="${update.site.username}@${update.site.host}:${update.site.directory}" />
<!-- Deploys a build to specified downloads website -->
<target name="deploy.downloads">
<antcall target="upload.build.content" />
<antcall target="upload.build.descriptor" />
<antcall target="upload.updateSite.content" />
</target>
<!-- Uploads the build content, i.e. all the .zip files found in the ${artifactsDirectory} -->
<target name="upload.build.content">
<echo message="Uploading build ${buildLabel} to ${download.site.label}" />
<echo message="From ${artifactsDirectory}" />
<scp sftp="true" verbose="true" todir="${download.site}" password="${download.site.password}">
<fileset dir="${artifactsDirectory}">
<include name="*.zip" />
<exclude name="*-test-*.zip" />
<include name="plugin-dependencies*" />
<include name="*.html" />
</fileset>
</scp>
<echo message="Done" />
</target>
<!-- Downloads any existing downloads.xml descriptor, patches it with the current build and uploads it back up -->
<target name="upload.build.descriptor">
<echo message="Downloading existing build descriptor (download.xml) from ${download.site.label}" />
<scp verbose="true" file="${download.site}/downloads.xml" todir="${artifactsDirectory}" password="${download.site.password}" />
<!-- update the download prefix in the build-details.xml -->
<replace file="${artifactsDirectory}/build-details.xml">
<replacefilter token="@download.prefix@" value="${download.site.prefix}" />
<replacefilter token="@download.prefix.direct@" value="${download.site.prefix.direct}" />
</replace>
<dsite.addReleaseNotes php="/tigerstripe/includes/releaseNotes.php" downloadsFile="${artifactsDirectory}/downloads.xml" newBuildFile="${artifactsDirectory}/build-details.xml" />
<dsite.mergeBuild downloadsFile="${artifactsDirectory}/downloads.xml" newBuildFile="${artifactsDirectory}/build-details.xml" />
<echo message="Copying to ${download.site}" />
<!-- This seems required to avoid timeout with the Eclipse SSH server -->
<echo message="Sleeping for 2 minutes to please the Eclipse server..."/>
<sleep minutes="2" />
<scp verbose="true" sftp="true" todir="${download.site}" password="${download.site.password}">
<fileset dir="${artifactsDirectory}">
<include name="*downloads.xml" />
</fileset>
</scp>
</target>
<target name="upload.updateSite.content">
<echo message="Uploading Update Site Content for ${buildLabel} to ${update.site.label}" />
<!-- This seems required to avoid timeout with the Eclipse SSH server -->
<echo message="Sleeping for 2 minutes to please the Eclipse server..."/>
<sleep minutes="2" />
<scp verbose="true" sftp="true" todir="${update.site}" password="${update.site.password}">
<fileset dir="${artifactsDirectory}/update-site">
<include name="${update.site.descriptor}" />
</fileset>
</scp>
<!-- This seems required to avoid timeout with the Eclipse SSH server -->
<echo message="Sleeping for 2 minutes to please the Eclipse server..."/>
<sleep minutes="2" />
<scp verbose="true" sftp="true" todir="${update.site}/features" password="${update.site.password}">
<fileset dir="${artifactsDirectory}/update-site/features">
<include name="*.jar" />
</fileset>
</scp>
<!-- This seems required to avoid timeout with the Eclipse SSH server -->
<echo message="Sleeping for 2 minutes to please the Eclipse server..."/>
<sleep minutes="2" />
<scp verbose="true" sftp="true" todir="${update.site}/plugins" password="${update.site.password}">
<fileset dir="${artifactsDirectory}/update-site/plugins">
<include name="*.jar" />
</fileset>
</scp>
<echo message="Done" />
</target>
</project>