herokuish
herokuish copied to clipboard
Only copy from app import path to app path when building
This PR fixes #402 (slug generate gzips from /tmp/app, when it should gzip from /app) and #321 (Cannot execute any Procfile commands) and fixed the issue mentioned in the blog post "Running Herokuish apps in Docker".
Currently every time herokuish is run the app import path (e.g. /tmp/app) is copied over to the app path (e.g. /app) if the import path exists and has files in it.
This PR changes this so that the copy from the import path to the app path is only done on running herokuish buildpack build
or herokuish buildpack test
as suggested by @matthewmueller in #402.
This means that you can now run buildpack build
immediately followed by procfile start
within the same container and things will work.
I can see at least two different ways that people were working around this issue before:
- Mount the application volume in the app directory (/app) rather than the import app directory (/tmp/app) as seen in Dokku. This has the disadvantage that build artifacts get written into the same directory as the source code (of course you might want this, you might not).
- By using the recommended flow as outlined by @michaelshobbs, you create a docker image from the result of running
buildpack build
and then running a container from that image which doesn't have a volume mounted at /tmp/app and so the contents of /app is not overwritten.
This PR should not break those workarounds.
Assigning to @michaelshobbs for review :)
@josegonzalez this should be tested with dokku before upgrading the default version
@josegonzalez is there anything I can do to help with the dokku testing?
@mlandauer thanks for PRing this – I'd love to see this pushed through!
Testing in dokku would require building the herokuish image and pushing a few apps with it.
I am pretty sure this will work based on a single test of a python app, but will try and get this more stress-tested soon.
Any chance of this to be released in the near future? I encountered the same problem and it would be great to have this merged. This change will certainly come in handy when I want to chain multiple herokuish commands.
This worked locally with Dokku like so:
BUILDX=false make build/docker/22 STACK_VERSION=22 && docker image tag herokuish:latest-22 gliderlabs/herokuish:latest-22 && tput bel
Apologies for getting to this so late, just didn't have the bandwidth/mental energy to work on it.