Skip to content

Commit

Permalink
version as tag
Browse files Browse the repository at this point in the history
  • Loading branch information
ekatek authored and Naomi Seyfer committed Dec 13, 2013
1 parent 19964b3 commit 7da8004
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
20 changes: 13 additions & 7 deletions packages/application-configuration/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,30 +69,36 @@ try {

AppConfig.getAppConfig = function () {
if (!subFuture.isResolved() && staticAppConfig) {
console.log("STATIC APP CONFIG");
return staticAppConfig;
}
subFuture.wait();
var myApp = OneAppApps.findOne(process.env.GALAXY_APP);
if (myApp)
return myApp.config;
throw new Error("there is no app config for this app");
if (!myApp) {
throw new Error("there is no app config for this app");
}
var config = myApp.config;
config.version = myApp.currentStar;
return config;
};

AppConfig.configurePackage = function (packageName, configure) {
var appConfig = AppConfig.getAppConfig(); // Will either be based in the env var,
// or wait for galaxy to connect.
var lastConfig =
(appConfig && appConfig.packages && appConfig.packages[packageName]) || {};
(appConfig && appConfig.packages &&
appConfig.packages[packageName]) || {};

// Always call the configure callback "soon" even if the initial configuration
// is empty (synchronously, though deferred would be OK).
// XXX make sure that all callers of configurePackage deal well with multiple
// callback invocations! eg, email does not
configure(lastConfig);
configure(_.extend({version: appConfig.version}, lastConfig));
var configureIfDifferent = function (app) {
if (!EJSON.equals(app.config && app.config.packages && app.config.packages[packageName],
if (!EJSON.equals(app.config && app.config.packages && app.config.packages[packageName] && app.config.version,
lastConfig)) {
lastConfig = app.config.packages[packageName];
configure(lastConfig);
configure(_.extend({version: appConfig.version}, lastConfig));
}
};
var subHandle;
Expand Down
7 changes: 6 additions & 1 deletion packages/webapp/webapp_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,8 @@ var runWebAppServer = function () {
} else {
proxyConf = configuration.proxy;
}
proxyConf.version = configuration.version;
Log("Attempting to bind to proxy at " + proxyService.providers.proxy);
console.log(proxyConf);
WebAppInternals.bindToProxy(_.extend({
proxyEndpoint: proxyService.providers.proxy
}, proxyConf), proxyServiceName);
Expand Down Expand Up @@ -661,10 +661,13 @@ WebAppInternals.bindToProxy = function (proxyConfig, proxyServiceName) {
};
};

var version = (proxyConfig.version) ? proxyConfig.version : "";

proxy.call('bindDdp', {
pid: pid,
bindTo: ddpBindTo,
proxyTo: {
tags: [version],
host: host,
port: port,
pathPrefix: bindPathPrefix + '/websocket'
Expand All @@ -678,6 +681,7 @@ WebAppInternals.bindToProxy = function (proxyConfig, proxyServiceName) {
pathPrefix: bindPathPrefix
},
proxyTo: {
tags: [version],
host: host,
port: port,
pathPrefix: bindPathPrefix
Expand All @@ -693,6 +697,7 @@ WebAppInternals.bindToProxy = function (proxyConfig, proxyServiceName) {
ssl: true
},
proxyTo: {
tags: [version],
host: host,
port: port,
pathPrefix: bindPathPrefix
Expand Down
1 change: 1 addition & 0 deletions tools/deploy-galaxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ exports.deploy = function (options) {
// fails (we already know the app exists.)
var info = prettyCall(galaxy, 'beginUploadStar', [options.app, bundleResult.starManifest]);

console.log("StarId: ", info.id);
// Upload
// XXX copied from galaxy/tool/galaxy.js
var fileSize = fs.statSync(starball).size;
Expand Down

0 comments on commit 7da8004

Please sign in to comment.