Giter Site home page Giter Site logo

rules_nfpm's Introduction

rules_nfpm

rules_nfpm provides rules for building 'deb' and 'rpm' packages using NFPM, a packager written in Go.

While rules_pkg works, rules_nfpm has the following advantages:

  • Clear documentation
  • No host dependencies (e.g. rpmbuild is not needed in PATH)
  • Built-in templating of Bazel workspace status key-value pairs

Setup

Include the following snippet in your repository's WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "com_github_ericnorris_rules_nfpm",
    sha256 = "800ebc64eac94d5ec6589e98a904c8c13aaad1ae0a981550de47a5ad7f72c660",
    urls = [
        "https://github.com/ericnorris/rules_nfpm/archive/v2.0.0.tar.gz",
    ],
    strip_prefix = "rules_nfpm-2.0.0",
)

load("@com_github_ericnorris_rules_nfpm//nfpm:repositories.bzl", "rules_nfpm_dependencies")

rules_nfpm_dependencies()

load("@com_github_ericnorris_rules_nfpm//nfpm:setup.bzl", "rules_nfpm_setup")

rules_nfpm_setup()

load("@com_github_ericnorris_rules_nfpm//nfpm:go_repositories.bzl", "rules_nfpm_go_dependencies")

rules_nfpm_go_dependencies()

nfpm_package

nfpm_package(name, config, deps)

Generates a package using NFPM.

The config file is templatized using the go text/template library. The dot (.) value is a ConfigTemplateData struct.

Example

nfpm_package(
    name = "helloworld.deb",
    config = "helloworld.yaml",
    deps = [
        "//cmd/helloworld",
    ],
)

See the example directory for a more comprehensive example.

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
config NFPM configuration file template. Label required
deps Dependencies for this target. The output path of each dependency will be available in the .Dependencies map in the configuration file template, keyed by the dependency's label. List of labels optional []

rules_nfpm's People

Contributors

ericnorris avatar aazakharchenko avatar azakharchenko-msol avatar

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.