jupyterhub / chartpress

automate building and publishing images for helm charts
BSD 3-Clause "New" or "Revised" License
55 stars 24 forks source link

Add BRANCH expansion #190

Closed bleggett closed 1 year ago

bleggett commented 1 year ago

Much like TAG or LAST_COMMIT, add an expansion for BRANCH to expand to the current Git branch.

This is useful if you are using OCI image caching via extraBuildArgs, like so:

        extraBuildCommandOptions:
          - --cache-to
          - type=registry,ref=ghcr.io/myorg/myimg-buildcache:{BRANCH}
          - --cache-from
          - type=registry,ref=ghcr.io/myorg/myimg-buildcache:{BRANCH}

PR branches won't have TAG for us, and LAST_COMMIT will create new caches for every new Git SHA, which defeats the purpose of a docker buildx cache save/restore.

NOTE - I cannot get the existing tests on main to pass locally with current Docker release, as the default docker build output format doesn't match what the tests expect - if I am missing something here let me know, otherwise I will try to debug any test failures via CI.

minrk commented 1 year ago

Thanks!

re: local build failures - yes, that's the changed output in buildkit. We need to fix that (#191), but as long as CI passes, we're okay for now. I beleive if you set DOCKER_BUILDKIT=0 you'll get tests passing locally.

welcome[bot] commented 1 year ago

Congrats on your first merged pull request in this project! :tada: congrats Thank you for contributing, we are very proud of you! :heart: