Created
June 22, 2012 18:12
-
-
Save fjakobs/2974306 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var architect = require("architect"); | |
var fs = require("fs"); | |
var path = require("path"); | |
var user = { | |
name: "fjakobs", | |
uid: 1 | |
}; | |
var project = { | |
name: "geekdots", | |
pid: 35, | |
path: "~/35", | |
remote: { | |
metadata: { | |
system: { | |
home: "/var/lib/stickshift/b47e93bb2b3240f0a8288376b60e11ec/app-root/data", | |
basePath: "/var/lib/stickshift/b47e93bb2b3240f0a8288376b60e11ec/app-root/data" | |
}, | |
connect: { | |
user: "b47e93bb2b3240f0a8288376b60e11ec", | |
host: "u153936p202394-c9devel.rhcloud.com" | |
} | |
} | |
} | |
}; | |
var options = { | |
host: "c9.dev", | |
privateKey: fs.readFileSync(__dirname + "/../settings/keys/devel", "ascii") | |
}; | |
var config = require("../runvm-templates/openshift")(user, project, options); | |
var scm, eventbus; | |
config.plugins.push({ | |
packagePath: "./c9.graceful-shutdown", | |
shutdown_grace_period: 2000 | |
}, "cloud9/plugins-server/cloud9.eventbus"); | |
var plugins = architect.resolveConfig(config.plugins, config.basePath); | |
plugins.push({ | |
packagePath: "inject.c9.runvm.exports", | |
provides: [], | |
consumes: ["workspace-scm", "eventbus"], | |
setup: function(options, imports, register) { | |
scm = imports["workspace-scm"]; | |
eventbus = imports.eventbus; | |
register(null, {}); | |
} | |
}); | |
architect.createApp(plugins, function (err, app) { | |
if (err) { | |
console.error("While starting"); | |
throw err; | |
} | |
console.log("Started!"); | |
scm.project("git", "create", ["35"], function(err, out) { | |
console.log("DONE", err, out); | |
process.exit(); | |
}) | |
// scm.project("git", "clone", ["git://github.com/fjakobs/geekdots.git", "35"], function(err, out) { | |
// console.log("DONE", err, out); | |
// process.exit(); | |
// }) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment