Skip to content
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

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@SemanticallyNull
Copy link
Member

commented Apr 30, 2019

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

  • defaults to "." if BP_APP_MAIN_PATH not set

With @iainsproat

Allow main package to be at non-root path of app
- introduces BP_APP_MAIN_PATH environmental variable
- defaults to "." if BP_APP_MAIN_PATH not set
@cfdreddbot

This comment has been minimized.

Copy link

commented Apr 30, 2019

Hey BenChapman! The commit authors and yourself have already signed the CLA.

@sclevine

This comment has been minimized.

Copy link
Member

commented May 3, 2019

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 buildpack.yml file instead of an environment variable. Maybe something like this:

gomod:
  paths: ["some/cmd/here", "another/cmd/overhere"] 
@scothis

This comment has been minimized.

Copy link
Member

commented May 3, 2019

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.

@sclevine

This comment has been minimized.

Copy link
Member

commented May 3, 2019

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 GO_INSTALL_PACKAGE_SPEC.

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:

BP_GO_MOD_TARGETS=some/cmd/different:another/cmd/overhere
@scothis

This comment has been minimized.

Copy link
Member

commented May 3, 2019

@sclevine sounds good.

If there are multiple targets, how do you set the entry point?

@sclevine

This comment has been minimized.

Copy link
Member

commented May 3, 2019

CMD is set to run the binary built from the first target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.