[gnome-continuous] autobuilder: Add a convenient set of symlinks for the last successful/failed build



commit 556fb17d6f9706f3f231c9521196713238152c03
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Oct 9 16:11:10 2013 -0400

    autobuilder: Add a convenient set of symlinks for the last successful/failed build

 src/js/builtins/autobuilder.js |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/js/builtins/autobuilder.js b/src/js/builtins/autobuilder.js
index 6aa8d3f..3d982f9 100644
--- a/src/js/builtins/autobuilder.js
+++ b/src/js/builtins/autobuilder.js
@@ -60,6 +60,9 @@ const Autobuilder = new Lang.Class({
 
         this._buildsDir = new VersionedDir.VersionedDir(this.workdir.get_child('builds'), this._VERSION_RE);
 
+        this._resultsDir = this.workdir.get_child('results');
+        GSystem.file_ensure_directory(this._resultsDir, true, cancellable);
+
        if (args.autoupdate_self)
            this._autoupdate_self = Gio.File.new_for_path(args.autoupdate_self);
 
@@ -99,11 +102,18 @@ const Autobuilder = new Lang.Class({
        if (task.name == 'resolve')
            this._runResolve();
 
+        let resultsPath;
+
        if (success) {
            print("Task " + task.name + " complete: " + task.buildName);
+            resultsPath = this._resultsDir.get_child('successful');
        } else {
            print("Task " + task.name + " failed: " + task.buildName);
+            resultsPath = this._resultsDir.get_child('failed');
        }
+
+        BuildUtil.atomicSymlinkSwap(resultsPath, task.buildPath, null);
+
        this._updateStatus();
     },
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]