GithubHelp home page GithubHelp logo

paketo-buildpacks / sbt Goto Github PK

View Code? Open in Web Editor NEW
9.0 6.0 1.0 677 KB

A Cloud Native Buildpack that builds SBT-based applications from source

License: Apache License 2.0

Go 96.87% Shell 3.13%
cnb sbt build-system jvm-applications

sbt's Introduction

gcr.io/paketo-buildpacks/sbt

The Paketo Buildpack for SBT is a Cloud Native Buildpack that builds SBT-based applications from source.

Behavior

This buildpack will participate all the following conditions are met

  • <APPLICATION_ROOT>/build.sbt exists

The buildpack will do the following:

  • Requests that a JDK be installed
  • Links the ~/.sbt to a layer for caching
  • If <APPLICATION_ROOT>/sbt exists
    • Runs <APPLICATION_ROOT>/sbt universal:packageBin to build the application
  • If <APPLICATION_ROOT>/sbt does not exist
    • Contributes SBT to a layer with all commands on $PATH
    • Runs <SBT_ROOT>/bin/sbt package to build the application
  • Removes the source code in <APPLICATION_ROOT>, following include/exclude rules
  • If $BP_SBT_BUILT_ARTIFACT matched a single file
    • Restores $BP_SBT_BUILT_ARTIFACT from the layer, expands the single file to <APPLICATION_ROOT>
  • If $BP_SBT_BUILT_ARTIFACT matched a directory or multiple files
    • Restores the files matched by $BP_SBT_BUILT_ARTIFACT to <APPLICATION_ROOT>

Configuration

Environment Variable Description
$BP_SBT_BUILD_ARGUMENTS Configure the arguments to pass to build system. Defaults to universal:packageBin.
$BP_SBT_BUILT_MODULE Configure the module to find application artifact in. Defaults to the root module (empty).
$BP_SBT_BUILT_ARTIFACT Configure the built application artifact explicitly. Supersedes $BP_SBT_BUILT_MODULE. Defaults to target/universal/*.zip. Can match a single file, multiple files or a directory. Can be one or more space separated patterns.
$BP_SBT_REPOSITORIES_FILE Specifies a custom location to SBT's repositories file.
$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

The buildpack optionally accepts the following bindings:

Type: dependency-mapping

Key Value Description
<dependency-digest> <uri> If needed, the buildpack will fetch the dependency with digest <dependency-digest> from <uri>

License

This buildpack is released under version 2.0 of the Apache License.

sbt's People

Contributors

anthonydahanne avatar dependabot[bot] avatar dmikusa avatar ekcasey avatar nebhale avatar paketo-bot avatar pivotal-david-osullivan avatar samj1912 avatar twoseat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

samj1912

sbt's Issues

Allow setting a SBT repositories via an env var

Describe the Enhancement

There are often times when the user/operator/stack provider would want an easy way to specify the sbt repositories to a file path in the builder/workspace which doesn't contain any credentials. For eg. changing the maven.ivy repositories.

Currently SBT BP doesn't expose a non project specific way of doing this.

Possible Solution

Allow defining a path to sbt repositories file.

Motivation

Support enterprise SBT repositories.

Support external cache location

If a user is running pack locally, or perhaps wants to do a very dangerous thing and share a cache across multiple platforms, this should be possible. If <platform>/sbt exists, it should be used for the cache.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.