This simple Ruby script started as a wrap around the Scalingo API to investigate and report on build times.
The native Scalingo CLI also provides duration data but in ASCII format which requires serious grep/awk skills to parse. It’s also a lot more fun in Ruby.
- get yourself a Scalingo API token;
- put it into a
SCALINGO_API_TOKEN
environment variable; - use
./bin/rubingo token
to get an exchange token; - explore
./bin/rubingo --help
.
export SCALINGO_API_TOKEN=my token
./bin/rubingo token # grab and write an exchange token in .env
./bin/rubingo repl betagouv-site # explore the betagouv-site resources
# if you app is hosted in the Secnum zone:
./bin/rubingo repl betagouv-prod --secnum
the above will drop you into a Ruby prompt with an api
object
instantiated with the right app:
api.deployments.last(10).map(&:duration)
api.collaborators.map(&:email)
deployments
;collaborators
.
PS: feel free to add new ones, it’s that easy.