-
Notifications
You must be signed in to change notification settings - Fork 12
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
Allow main package to be at non-root path of app #2
Conversation
✅ Hey BenChapman! The commit authors and yourself have already signed the CLA. |
Sorry for the delay! We're still working on Tracker integration for the new buildpacks. I think we'd like this to be configurable via a gomod:
paths: ["some/cmd/here", "another/cmd/overhere"] |
It's common to have multiple targets within a single repo that should each be compiled into separate images. The target package should be configurable per build. |
That makes sense. I think we should also support multiple targets in the same image as well (e.g., for extra binaries for DB migrations, debug tools, etc.). The v2 version of the buildpack support multiple targets via We're trying to capture all of the build configuration in buildpack.yml and only introduce environment variables where parameters could reasonably vary across builds. I agree that this is one of those cases -- I should have considered that in my previous comment. How about we support a default set of targets in buildpack.yml: go-mod:
targets: ["some/cmd/here", "another/cmd/overhere"] As well as an environment variable to override that set:
|
@sclevine sounds good. If there are multiple targets, how do you set the entry point? |
|
* env var BP_GO_MOD_TARGETs * allows multiple packages to be specified, delimited by colon :
Targets to build in the app directory can be defined in yaml file `buildpack.yml` at the root of the application file Added integration tests
[#166378921] Signed-off-by: Shane Huston <shuston@pivotal.io>
[#165933655] Signed-off-by: Katie Chapman <kchapman@pivotal.io>
@sclevine the update that we just pushed should fix the functionality to what you described in a previous comment. |
[#165933655] Signed-off-by: Shane Huston <shuston@pivotal.io>
This is looking great! We discussed the format of buildpack.yml today and decided that language-specific tooling should be nested under a language key. Happy for whoever merges to adjust this, but it should be either:
or:
depending on if the targets concept is general enough to apply to all ways of building go apps (e.g., dep). I think it is, so I support the second option. |
We've made those changes, we used the latter as the way to do things.
This was because we were trying to pass the environment variable into the |
It was not possible to build an application if it had a main package that was not in the root of the workspace. This PR creates an environment variable which will allow users to set a path.
Introduces BP_APP_MAIN_PATH environmental variable
With @iainsproat