nfpmwrapper

package
v0.0.0-...-1b99926 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package nfpmwrapper is an internal package used by rules_nfpm in order to connect bazel to NFPM.

nfpmwrapper is not meant for use outside of rules_nfpm, but is documented to provide information on package config template data and internals.

Index

Constants

View Source
const (
	FormatDeb = "deb"
	FormatRPM = "rpm"
)

Package formats supported by this wrapper and NFPM.

Variables

View Source
var ExtensionFormatMap = map[string]string{
	".deb": FormatDeb,
	".rpm": FormatRPM,
}

ExtensionFormatMap is a map of package extension to package format.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	// Config is the path to a config file that will be used as a template.
	Config string `name:"config" type:"existingfile"`

	// StableStatus and Volatile status are paths to bazel's workspace status
	// files.
	StableStatus   string `name:"stable-status" type:"existingfile"`
	VolatileStatus string `name:"volatile-status" type:"existingfile"`

	// Deps is an array of label-path pairs, delimited by an equals (=) sign.
	Deps []string `name:"dep"`

	// Output is the desired path for the generated package. The extension is
	// used to lookup the package format in ExtensionFormatMap.
	Output string `arg`
}

Cmd is a struct defining parameters for templating an NFPM config and generating a package using NFPM.

func (*Cmd) Run

func (c *Cmd) Run() error

Run uses the value of the Cmd struct and generates a DEB or RPM package using NFPM. The specified config value is executed as a text/template template in order to populate the file with information from bazel.

type ConfigTemplateData

type ConfigTemplateData struct {
	// StableStatus contains the key-value pairs in stable-status.txt. See
	// https://docs.bazel.build/versions/master/user-manual.html#workspace_status
	// for details.
	StableStatus map[string]string

	// VolatileStatus contains the key-value pairs in volatile-status.txt. See
	// https://docs.bazel.build/versions/master/user-manual.html#workspace_status
	// for details.
	VolatileStatus map[string]string

	// Dependencies is a map of a bazel dependencies. The map key is the label
	// of the dependency, and the map value is the dependency's path. For
	// example, "//path/to/package:target": "path/to/output".
	Dependencies map[string]string
}

ConfigTemplateData is the data available for use inside of the NFPM YAML config.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL