Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Make the actual scale work
Browse files Browse the repository at this point in the history
  • Loading branch information
adgad committed May 5, 2015
1 parent 1d8157d commit 46d4ca5
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions tasks/scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ var packageJson = require(process.cwd() + '/package.json');
var herokuAuthToken = require('../lib/heroku-auth-token');
var normalizeName = require('../lib/normalize-name');
var fetchres = require('fetchres');
// var scale = require('haikro/lib/scale');
var scale = require('haikro/lib/scale');

module.exports = function(opts) {

var source = opts.source || normalizeName(packageJson.name, { version: false });
var target = opts.target || normalizeName(packageJson.name);
var target = opts.target || packageJson.name;
var overrides = {};
var token;

Expand All @@ -27,6 +27,7 @@ module.exports = function(opts) {
serviceData.versions[Object.keys(serviceData.versions).length.toString()].processes;
}

console.log('Scaling ' + target + ' using service registry information for ' + source);
return herokuAuthToken()
.then(function(authToken) {
token = authToken;
Expand Down Expand Up @@ -60,13 +61,18 @@ module.exports = function(opts) {
}
}

// scale({
// token: token,
// app: target
// processProfiles: processProfiles
// })
return scale({
token: token,
app: target,
processProfiles: processProfiles
});


})
.then(function() {
console.log(target + " config vars are set");
.then(function(processProfiles) {
console.log(target + " config vars are set to", processProfiles);
})
.catch(function(err) {
console.log ('Error scaling processes - ' + err);
});
};

0 comments on commit 46d4ca5

Please sign in to comment.