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

Add instruction for including/excluding additional files with a Java app #110

Merged
merged 1 commit into from
Oct 5, 2022
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The buildpack will do the following:
* If `<APPLICATION_ROOT>/deps.edn` exists
* Contributes Clojure Tools to a layer with all commands on `$PATH`
* Runs `<CLOJURE_TOOLS_ROOT>/clojure -X:uberjar` to build the application
* Removes the source code in `<APPLICATION_ROOT>`
* Removes the source code in `<APPLICATION_ROOT>`, following include/exclude rules
* If `$BP_CLJ_BUILT_ARTIFACT` matched a single file
* Restores `$BP_CLJ_BUILT_ARTIFACT` from the layer, expands the single file to `<APPLICATION_ROOT>`
* If `$BP_CLJ_BUILT_ARTIFACT` matched a directory or multiple files
Expand All @@ -30,6 +30,8 @@ The buildpack will do the following:
| `$BP_CLJ_DEPS_ARGUMENTS` | Configure the arguments to pass to build system. Defaults to `-X:uberjar`. |
| `$BP_CLJ_BUILT_MODULE` | Configure the module to find application artifact in. Defaults to the root module (empty). |
| `$BP_CLJ_BUILT_ARTIFACT` | Configure the built application artifact explicitly. Supersedes `$BP_CLJ_BUILT_MODULE`. Defaults to `target/*.jar`. Can match a single file, multiple files or a directory. Can be one or more space separated patterns. |
| `$BP_INCLUDE_FILES` | Colon separated list of glob patterns to match source files. Any matched file will be retained in the final image. Defaults to `` (i.e. nothing). |
| `$BP_EXCLUDE_FILES` | Colon separated list of glob patterns to match source files. Any matched file will be specifically removed from the final image. If include patterns are also specified, then they are applied first and exclude patterns can be used to further reduce the fileset. |

## Bindings

Expand Down
12 changes: 12 additions & 0 deletions buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ api = "0.7"
description = "the module to find application artifact in"
name = "BP_CLJ_BUILT_MODULE"

[[metadata.configurations]]
build = true
default = ""
description = "colon separated list of glob patterns, matched source files are included"
name = "BP_INCLUDE_FILES"

[[metadata.configurations]]
build = true
default = ""
description = "colon separated list of glob patterns, matched source files are removed"
name = "BP_EXCLUDE_FILES"

[[metadata.dependencies]]
cpes = ["cpe:2.3:a:cognitect:clojure:1.11.1:*:*:*:*:*:*:*"]
id = "clojure"
Expand Down