Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/releng
diff options
context:
space:
mode:
authorDoug Schaefer2003-07-24 20:27:32 +0000
committerDoug Schaefer2003-07-24 20:27:32 +0000
commitbcbcf4266cb454059ef3144949b8bc91d7fbc81e (patch)
tree570e3f5a071723e5d1e0b84b796b291ac12d3d4a /releng
parent191615c830d0ad512a3cc02d411193032e8317a9 (diff)
downloadorg.eclipse.cdt-bcbcf4266cb454059ef3144949b8bc91d7fbc81e.tar.gz
org.eclipse.cdt-bcbcf4266cb454059ef3144949b8bc91d7fbc81e.tar.xz
org.eclipse.cdt-bcbcf4266cb454059ef3144949b8bc91d7fbc81e.zip
Added automatic upload of the test result reports.
Diffstat (limited to 'releng')
-rw-r--r--releng/org.eclipse.cdt.releng/doall4
-rw-r--r--releng/org.eclipse.cdt.releng/doinstall2
-rw-r--r--releng/org.eclipse.cdt.releng/dopost16
-rw-r--r--releng/org.eclipse.cdt.releng/edit.pl24
-rw-r--r--releng/org.eclipse.cdt.releng/plugin.xml10
-rw-r--r--releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/DoBuild.java18
-rw-r--r--releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/PostResults.java69
7 files changed, 139 insertions, 4 deletions
diff --git a/releng/org.eclipse.cdt.releng/doall b/releng/org.eclipse.cdt.releng/doall
index 1061fa8314..f695d0eaf4 100644
--- a/releng/org.eclipse.cdt.releng/doall
+++ b/releng/org.eclipse.cdt.releng/doall
@@ -6,9 +6,9 @@
if [ -n "$CDT_ROOT" ]; then cd $CDT_ROOT; fi
-for i in dobuild doinstall dotest
+for i in dobuild doinstall dotests dopost
do
- if ! $i
+ if ! workspace/org.eclipse.cdt.releng/$i
then
echo $i failed
exit 1
diff --git a/releng/org.eclipse.cdt.releng/doinstall b/releng/org.eclipse.cdt.releng/doinstall
index 461bcf590d..a47012e206 100644
--- a/releng/org.eclipse.cdt.releng/doinstall
+++ b/releng/org.eclipse.cdt.releng/doinstall
@@ -23,7 +23,7 @@ do
export DEST=$d/`echo $i | sed -e s:$BUILD_SITE/$d/:: -e s/.jar//`
mkdir $DEST
cd $DEST
- jar xf $i
+ jar xf ../../$i
cd ../..
done
done
diff --git a/releng/org.eclipse.cdt.releng/dopost b/releng/org.eclipse.cdt.releng/dopost
new file mode 100644
index 0000000000..d711fdc949
--- /dev/null
+++ b/releng/org.eclipse.cdt.releng/dopost
@@ -0,0 +1,16 @@
+cd results
+
+# Update the build page
+
+export CDT_VERSION=`cat version.txt`
+export CDT_LOGS=`echo org.*.html`
+
+../workspace/org.eclipse.cdt.releng/edit.pl $CDT_VERSION $CDT_LOGS < index.html > index2.html
+mv index2.html index.html
+cd ..
+
+# Upload to build page using eclipse
+
+./eclipse -nosplash -application org.eclipse.cdt.releng.postResults \
+ -version $CDT_VERSION -logs $CDT_LOGS \
+ -vmargs -Dcdt.build.user=$CDT_USER -Dcdt.build.passwd=$CDT_PASSWD
diff --git a/releng/org.eclipse.cdt.releng/edit.pl b/releng/org.eclipse.cdt.releng/edit.pl
new file mode 100644
index 0000000000..da5cc6dbc4
--- /dev/null
+++ b/releng/org.eclipse.cdt.releng/edit.pl
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+
+# First arg is version number
+# The rest are the log files
+
+foreach (<STDIN>)
+{
+ if (/<!--new..>/)
+ {
+ $version = shift;
+ $date = `date`;
+ chomp $date;
+ print " <li>$version - $date</li>\n";
+ print " <ul>\n";
+ foreach (@ARGV)
+ {
+ $plugin = $_;
+ $plugin =~ s/\.html//;
+ print " <li><a href=\"logs/$version/$_\">$plugin</a></li>\n"
+ }
+ print " </ul>\n";
+ }
+ print $_;
+}
diff --git a/releng/org.eclipse.cdt.releng/plugin.xml b/releng/org.eclipse.cdt.releng/plugin.xml
index c7be26fca1..7bd549b675 100644
--- a/releng/org.eclipse.cdt.releng/plugin.xml
+++ b/releng/org.eclipse.cdt.releng/plugin.xml
@@ -31,5 +31,15 @@
</run>
</application>
</extension>
+ <extension
+ id="postResults"
+ name="Post Build Results"
+ point="org.eclipse.core.runtime.applications">
+ <application>
+ <run
+ class="org.eclipse.cdt.releng.PostResults">
+ </run>
+ </application>
+ </extension>
</plugin>
diff --git a/releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/DoBuild.java b/releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/DoBuild.java
index f7d4b3500c..f815d9dea1 100644
--- a/releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/DoBuild.java
+++ b/releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/DoBuild.java
@@ -4,6 +4,7 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
+import java.io.PrintStream;
import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
@@ -21,8 +22,10 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.pde.core.plugin.IFragment;
import org.eclipse.pde.core.plugin.IPlugin;
import org.eclipse.pde.internal.core.feature.WorkspaceFeatureModel;
@@ -213,8 +216,13 @@ public class DoBuild implements IPlatformRunnable {
ftp.login(ftpUser, ftpPassword);
ftp.chdir(ftpPath);
+ IPath resultDir = Platform.getLocation().removeLastSegments(1).append("results");
+ OutputStream stream = new FileOutputStream(resultDir.append("index.html").toOSString());
+ ftp.get(stream, "index.html");
+ stream.close();
+
IFile file = buildSite.getFile("version.xml");
- OutputStream stream = new FileOutputStream(file.getRawLocation().toOSString());
+ stream = new FileOutputStream(file.getRawLocation().toOSString());
ftp.get(stream, "version.xml");
stream.close();
@@ -255,6 +263,14 @@ public class DoBuild implements IPlatformRunnable {
transformer.transform(new DOMSource(versionDoc), new StreamResult(versionResult));
versionFile.refreshLocal(IResource.DEPTH_ONE, monitor);
version = versionId + "." + buildNum;
+
+ // Save the version in a text file for inclusion in the build page
+ IPath resultDir = Platform.getLocation().removeLastSegments(1).append("results");
+ OutputStream stream = new FileOutputStream(resultDir.append("version.txt").toOSString());
+ PrintStream versionText = new PrintStream(stream);
+ versionText.println(version);
+ stream.close();
+
System.out.println("Version: " + version);
// Go through the projects and update the version info
diff --git a/releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/PostResults.java b/releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/PostResults.java
new file mode 100644
index 0000000000..2f8d154fef
--- /dev/null
+++ b/releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/PostResults.java
@@ -0,0 +1,69 @@
+package org.eclipse.cdt.releng;
+
+import java.io.FileInputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.boot.IPlatformRunnable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
+
+import com.enterprisedt.net.ftp.FTPClient;
+import com.enterprisedt.net.ftp.FTPConnectMode;
+
+/**
+ * This application ftps the test results up to the server.
+ * @see IPlatformRunnable
+ */
+public class PostResults implements IPlatformRunnable {
+
+ private static final String ftpHost = "download.eclipse.org";
+ private static final String ftpPath = "cdt/updates/builds/1.2";
+ private static final String ftpUser = System.getProperty("cdt.build.user");
+ private static final String ftpPassword = System.getProperty("cdt.build.passwd");
+
+ public PostResults() {
+ }
+
+ /**
+ * @see IPlatformRunnable#run
+ */
+ public Object run(Object args) throws Exception {
+ // Get the goodies out of the argument list
+ String version = "unversioned";
+ List logs = new ArrayList();
+
+ String[] strargs = (String[])args;
+ for (int i = 0; i < strargs.length; ++i)
+ if (strargs[i].equals("-version")) {
+ version = strargs[++i];
+ } else if (strargs[i].equals("-logs")) {
+ for (i++; i < strargs.length; ++i) {
+ logs.add(strargs[i]);
+ }
+ }
+
+ IPath resultDir = Platform.getLocation().removeLastSegments(1).append("results");
+
+ // Open ftp connection
+ FTPClient ftp = new FTPClient(ftpHost);
+ ftp.setConnectMode(FTPConnectMode.ACTIVE);
+ ftp.login(ftpUser, ftpPassword);
+ ftp.chdir(ftpPath);
+
+ // Upload the html files
+ ftp.put(new FileInputStream(resultDir.append("index.html").toOSString()), "index.html");
+
+ ftp.chdir("logs");
+ ftp.mkdir(version);
+ ftp.chdir(version);
+
+ for (int i = 0; i < logs.size(); ++i) {
+ String log = (String)logs.get(i);
+ ftp.put(new FileInputStream(resultDir.append(log).toOSString()), log);
+ }
+
+ ftp.quit();
+ return null;
+ }
+}

Back to the top