-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Allow builders to be detected based on repository contents #4379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
592af8b to
c3ee911
Compare
|
Awesome, thank you! This is kind of a weird hook because order matters but there's no good way to control the order. If I'm reading the Here's an alternative; it might be silly, but I'll let you judge that. Create a file, let's say plugn trigger builder-detect "$APP" "$TMP_WORK_DIR" |
grep -m1 -Fxf - BUILDERSGive the admin a way to edit that order (just Also, with the PR as it stands, emitting multiple lines from a But also this might all be over-engineering. 🤷 Meanwhile, in case some future reader wants more rationale for this PR: the reason I want it is to use Nix to build Docker images, instead of either Dockerfile or Herokuish/CNB. |
|
Alright, here's a Nix builder plugin that makes use of the new builder-detect hook: https://github.com/jameysharp/dokku-builder-nix I tested it against this branch, in the Dokku Vagrant image, and it works for the one thing I tried pushing to it. So this branch seems good to me! |
|
I do also wonder if the built-in builders should be renamed. My concern is if I ever need to add commands, those will not work. We could probably remove the existing order of operations issues by renaming We could also change the detection a bit to match the style of heroku's buildpack I'll redo update the PR with the rename and introduce the |
|
It occurs to me that another option is to refuse to pick a builder if multiple choices apply, and require |
Rather than hardcode two builders, allow builders to specify a `builder-detect` trigger. This trigger can be used to specify if the builder should or should not be used for an application. Each builder takes stdin and can decide if it wants to emit it or emit it's own image source type. If the final value is empty, then Dokku will default to herokuish (and cnb once that is stable). In addition, a future change may allow users to manually specify a builder in the case they wish to override the choice selected by Dokku. This change enables users to build custom builder plugins and have those plugins used for building an image asset. By way of example, an enterprising user could create a `builder-lambda` based on lambci, and then pair this with a scheduler plugin that updates a lambda function on AWS. Alternatively, a user might decide they wish to place their Dockerfile in a specific directory for their applications - such as an `_infrastructure` directory - and create a plugin to override how that is detected within Dokku.
The builder-pack rename makes this unnecessary.
Also rename internal cnb references to pack (where possible).
This plugin will allow users to override the builder used for their application, enabling users to use custom builders if desired.
c3ee911 to
6ea57da
Compare
# History ## 0.24.0 Install/update via the bootstrap script: ```shell wget https://raw.githubusercontent.com/dokku/dokku/v0.24.0/bootstrap.sh sudo DOKKU_TAG=v0.24.0 bash bootstrap.sh ``` See the [0.24.0 migration guide](/docs/appendices/0.24.0-migration-guide.md) for more information on migrating to 0.24.0. ### Bug Fixes - #4449: @josegonzalez Gitignore trigger symlink - #4447: @josegonzalez Checkout code to ensure the bump-azure script is available ### New Features - #4453: @josegonzalez Simplify tar and zip deploys via git:from-archive - #4450: @josegonzalez Simplify docker image deploys via git:from-image - #4379: @josegonzalez Allow builders to be detected based on repository contents - #4425: @josegonzalez Implement heroku's postdeploy deployment task - #4424: @josegonzalez Implement git:auth command - #4419: @josegonzalez Add parallelism to certain proxy commands ### Refactors - #4374: @josegonzalez Change exit code when app does not exist ### Documentation - #4451: @josegonzalez Update links to builder documentation to avoid extra rewrite - #4448: @josegonzalez Add documentation for git push to dokku-in-docker
|
Thank you for merging this! I don't think GitHub notified me at the time, so I only just noticed. Seems to work great! |
Rather than hardcode two builders, allow builders to specify a
builder-detecttrigger. This trigger can be used to specify if the builder should or should not be used for an application. Each builder takes stdin and can decide if it wants to emit it or emit it's own image source type.If the final value is empty, then Dokku will default to herokuish (and cnb once that is stable). In addition, a future change may allow users to manually specify a builder in the case they wish to override the choice selected by Dokku.
This change enables users to build custom builder plugins and have those plugins used for building an image asset. By way of example, an enterprising user could create a
builder-lambdabased on lambci, and then pair this with a scheduler plugin that updates a lambda function on AWS. Alternatively, a user might decide they wish to place their Dockerfile in a specific directory for their applications - such as an_infrastructuredirectory - and create a plugin to override how that is detected within Dokku.Note: If this PR is just doc changes, please put [ci skip] in the body that way tests do not run.