Skip to content

Instantly share code, notes, and snippets.

View jbuck's full-sized avatar

Jon Buckley jbuck

  • Mozilla
  • Toronto, ON
View GitHub Profile
#!/usr/bin/env python3
import click
import requests
# Create a group for all subcommands
# http://click.palletsprojects.com/en/7.x/quickstart/#nesting-commands
@click.group()
@click.option('--host', default='https://bounceradmin-default.dev.mozaws.net', show_default=True)
@click.option('--username')
@jbuck
jbuck / releases.js
Created May 15, 2020 17:04
Heroku apps + latest release in a spreadsheet
const Heroku = require('heroku-client')
const heroku = new Heroku({ token: process.env.HEROKU_API_TOKEN })
const main = async () => {
const apps = (await heroku.get(`/apps`)).map(m => { return { created_at: m.created_at, name: m.name, stack: m.stack.name } })
console.log(['App Name', 'Created At', 'Stack', 'Version', 'Description', 'Released At', 'User'].join('\t'))
for (app of apps) {
const releases = await heroku.get(`/apps/${app.name}/releases`)