Skip to content

Leverage Heroku CI in buildpacks for zero-configuration CI

Description

Heroku CI augments standard buildpacks with a couple CI-specific steps (bin/test-compile and bin/test). They have about 6 languages supported currently and I'm sure it will take a while for third-party buildpacks to support these new steps, but if it takes off, it could be an easy way to get people started with CI without having to configure anything themselves. We already leverage buildpacks for auto deploy, how about leveraging it for zero-configuration CI?

Note, Heroku CI also augments app.json with scripts.test-setup and scripts.test, and adds an environments:test way to declare addons needed during tests. We don't currently listen to app.json at all, but we could, if we wanted to have compatibility with Heroku CI for people who have gone beyond vanilla buildpack usage. app.json has a lot of the same goals as our .gitlab-ci.yml.

Proposal

  • Update herokuish with latest buildpacks
  • Add test commands to herokuish (Note there already is a test command, with a different purpose.)
    • Make sure handling of "no tests" is reasonable (probably should no-op succeed rather than error)
  • Add test commands to our auto deploy image
  • Add test commands to Auto Deploy template
  • Add test commands to Auto DevOps template

Links / references

Test projects

So far successfully tested on next projects:

  1. Clojure, no db -> https://gitlab.com/dzaporozhets/clj-hello-world
  2. Rails, Postgres -> https://gitlab.com/dzaporozhets/rails-hello-world
  3. Nodejs, Express -> https://gitlab.com/dzaporozhets/express-hello-world
  4. Java, Spring -> https://gitlab.com/dzaporozhets/spring-hello-world
  5. Scale, Play -> https://gitlab.com/dzaporozhets/play-hello-world

Build fails

  1. Python, django -> https://gitlab.com/dzaporozhets/django-hello-world. Buildpack does not support test command
  2. Ruby, no tests -> https://gitlab.com/dzaporozhets/sample-ruby-app/-/jobs/30607321
Edited by Mark Pundsack