Skip to content

Instantly share code, notes, and snippets.

@SindreSvendby
Created October 14, 2015 21:39
Show Gist options
  • Save SindreSvendby/4f5b410ccabd71ffaff9 to your computer and use it in GitHub Desktop.
Save SindreSvendby/4f5b410ccabd71ffaff9 to your computer and use it in GitHub Desktop.
Test to check if some of the apps I have is on the old cedar platform in heroku
// The legacy Cedar-10 stack has been deprecated and will reach its end-of-life on November 4, 2015.
// To see if some of your apps is old;
// HEROKU_API_TOKEN="<YOUR_HEROKU_TOKEN_HERE>" node ceadar-test.js
const Heroku = require('heroku-client');
const hl = require('highland');
var hk = new Heroku({
token: process.env.HEROKU_API_TOKEN
});
var hkApps = hk.apps();
var list = hl.wrapCallback(hkApps.list.bind(hkApps));
list()
.flatMap(x => x)
.pick(['name', 'stack'])
.map(x => ({appName: x.name, stackName: x.stack.name}))
.filter(x => x.stackName !== 'cedar-14')
.toArray((a) => {
if(a.length === 0) console.log('All of your apps are on the cedar-14 app');
else console.log('\n\nThis apps are missing on cedar-14:\n %s', JSON.stringify(a, null, 2));
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment