Skip to content

Conversation

Tashows
Copy link

@Tashows Tashows commented Sep 25, 2025

I am working on a feature and want to be able to call this via dokku. Ideally dokku buildpacks:detect app_name, alternatively via a custom plugin. Let me know which one would make more sense.

Basically just needs to run something like this:

docker run --rm \
  -v "$APP_ROOT:/tmp/app" \
  ${BUILDPACK_DETECT_OUTPUT:+-e BUILDPACK_DETECT_OUTPUT="$BUILDPACK_DETECT_OUTPUT"} \
  gliderlabs/herokuish \
  /bin/herokuish buildpack detect /tmp/app
;;

If this is moved into buildpacks (or a separate) plugin, then the part that checks out a potential bare git repo, could probably be moved there as well and just run before the command above. Not sure about permissions complications.

@josegonzalez
Copy link
Member

Yeah I feel like the part that checks out the repo should be separate from here, can you make that change?

@Tashows
Copy link
Author

Tashows commented Sep 30, 2025

Cleared that out and also added handling json output when multiple buildpacks are detected.

Would you like me to add the relevant functionality to utilize this in the core buildpacks plugin? Or would you rather I create a separate plugin?

@Tashows
Copy link
Author

Tashows commented Sep 30, 2025

It might be useful to add "url", "slug" (eg. "heroku/ruby") or even "version" (eg. "v321") to the json output, but I am not sure how to get these. If that makes sense, do you have any suggestions I can look into?

@josegonzalez
Copy link
Member

I'd actually rather not have this tool expose json output. Mind removing that?

The detected buildpack will be in the buildpack-url and the buildpack-version file: https://github.com/gliderlabs/herokuish/blob/master/buildpacks/buildpack-clojure/buildpack-url https://github.com/gliderlabs/herokuish/blob/master/buildpacks/buildpack-clojure/buildpack-version

@Tashows
Copy link
Author

Tashows commented Sep 30, 2025

Cleared that up as well. It was optional and nice-to-have really, but I get it.

Let me know if you'd rather have this functionality utilized in the core "buildpacks" dokku plugin (so we can run dokku buildpacks:detect app_name), or I make a separate plugin.

Thanks for the comments.

@josegonzalez josegonzalez changed the title Expose detect Expose buildpack detection as a command Oct 1, 2025
@josegonzalez
Copy link
Member

Mind adding a test for this functionality?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants