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

How to use BP_GO_WORK_USE #768

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions content/docs/howto/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,21 @@ cat /tmp/sbom-output/build/paketo-buildpacks_go-mod-vendor/sbom.cdx.json
{{< /code/copyable >}}
<!-- spellchecker-enable -->

## Use workspace modules
Some projects depend on multi-module workspaces and use relative `replace` directives within the same repository.
An example for this is [[email protected]](https://github.com/cert-manager/cert-manager/tree/v1.13.3).
In such case you may want to initialize and use workspace modules prior to building.

With `BP_GO_WORK_USE` the Go buildpack can be configured to `go work use (...)` certain modules before building.

{{< code/copyable >}}
pack build my-app --buildpack paketo-buildpacks/go \
--env BP_GO_WORK_USE=./cmd/my-module \
--env BP_GO_TARGETS=./cmd/my-module
{{< /code/copyable >}}

It will run `go work init` before running `go work use (...)`.

<!-- References -->
[cnb/launch-process]:https://buildpacks.io/docs/app-developer-guide/run-an-app/

Expand Down
1 change: 1 addition & 0 deletions scripts/.util/spellcheck-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ vendoring
watchexec
webserver
webservers
workspaces
writeable
yarnrc
yourkit
Loading