Skip to content

Commit

Permalink
Merge pull request #110 from paketo-buildpacks/include-exclude
Browse files Browse the repository at this point in the history
Add instruction for including/excluding additional files with a Java app
  • Loading branch information
pivotal-david-osullivan authored Oct 5, 2022
2 parents 2a7de40 + 0ae447a commit 4a002ee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
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

0 comments on commit 4a002ee

Please sign in to comment.