Skip to content
Bazel rules for assembling and deploying software distributions (see @graknlabs for usage example)
Branch: master
Clone or download
vmax Fix npm target in assemble/deploy npm rules (#173)
## What is the goal of this PR?

Fix `deploy_npm` rule implementation

## What are the changes implemented in this PR?

Use `npm` label that's compatible with both `assemble_npm` and `deploy_npm`
Latest commit db638bd Jul 19, 2019

README.md

assemble_maven

assemble_maven(name, developers, license, package, project_description, project_name, project_url, scm_url, target, version_file, workspace_refs)

Assemble Java package for subsequent deployment to Maven repo

Attributes

name Name; required

A unique name for this target.

developers Dictionary: String -> List of strings; optional

Project developers to fill into pom.xml

license String; optional

Project license to fill into pom.xml

package String; optional

Bazel package of this target. Must match one defined in `_maven_packages`

project_description String; optional

Project description to fill into pom.xml

project_name String; optional

Project name to fill into pom.xml

project_url String; optional

Project URL to fill into pom.xml

scm_url String; optional

Project source control URL to fill into pom.xml

target Label; required

Java target for subsequent deployment

version_file Label; optional

File containing version string. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version at all defaults to '0.0.0'

workspace_refs Label; required

JSON file describing dependencies to other Bazel workspaces

assemble_npm

assemble_npm(name, target, version_file)

Assemble npm_package target for further deployment

Attributes

name Name; required

A unique name for this target.

target Label; required

`npm_library` label to be included in the package

version_file Label; optional

File containing version string. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version at all defaults to '0.0.0'

assemble_pip

assemble_pip(name, author, author_email, classifiers, description, install_requires, keywords, license, long_description_file, package_name, target, url, version_file)

Attributes

name Name; required

A unique name for this target.

author String; required

Details about the author

author_email String; required

The email for the author

classifiers List of strings; required

A list of strings, containing Python package classifiers

description String; required

A string with the short description of the package

install_requires List of strings; required

A list of strings which are names of required packages for this one

keywords List of strings; required

A list of strings, containing keywords

license String; required

The type of license to use

long_description_file Label; required

A label with the long description of the package. Usually a README or README.rst file

package_name String; required

A string with Python pip package name

target Label; required

`py_library` label to be included in the package

url String; required

A homepage for the project

version_file Label; optional

File containing version string. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version at all defaults to '0.0.0'

assemble_versioned

assemble_versioned(name, targets, version_file)

Version multiple archives for subsequent simultaneous deployment

Attributes

name Name; required

A unique name for this target.

targets List of labels; optional

Archives to version and put into output archive

version_file Label; required

File containing version string

checksum

checksum(name, archive)

Computes SHA256 checksum of file

Attributes

name Name; required

A unique name for this target.

archive Label; required

Archive to compute checksum of

deploy_apt

deploy_apt(name, deployment_properties, target)

Deploy package built with assemble_apt to APT repository

Attributes

name Name; required

A unique name for this target.

deployment_properties Label; required

Properties file containing repo.apt.(snapshot|release) key

target Label; optional

assemble_apt label to deploy

deploy_brew

deploy_brew(name, checksum, deployment_properties, formula, type, version_file)

Deploy Homebrew (Caskroom) formula to Homebrew tap

Attributes

name Name; required

A unique name for this target.

checksum Label; optional

Checksum of deployed artifact

deployment_properties Label; required

Properties file containing repo.brew.(snapshot|release) key

formula Label; required

The brew formula definition

type String; optional

Type of deployment (Homebrew/Caskroom). Cask is generally used for graphic applications

version_file Label; optional

File containing version string. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version at all defaults to '0.0.0'

deploy_github

deploy_github(name, archive, deployment_properties, release_description, title, title_append_version, version_file)

Deploy assemble_versioned target to GitHub Releases

Attributes

name Name; required

A unique name for this target.

archive Label; optional

`assemble_versioned` label to be deployed.

deployment_properties Label; required

File containing `repo.github.organisation` and `repo.github.repository` keys

release_description Label; optional

Description of GitHub release

title String; optional

Title of GitHub release

title_append_version Boolean; optional

Append version to GitHub release title

version_file Label; optional

File containing version string. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version at all defaults to '0.0.0'

deploy_maven

deploy_maven(name, deployment_properties, target)

Deploy assemble_maven target into Maven repo

Attributes

name Name; required

A unique name for this target.

deployment_properties Label; required

Properties file containing repo.maven.(snapshot|release) key

target Label; optional

assemble_maven target to deploy

deploy_npm

deploy_npm(name, deployment_properties, target)

Attributes

name Name; required

A unique name for this target.

deployment_properties Label; required

File containing Node repository url by `repo.npm` key

target Label; required

`assemble_npm` label to be included in the package

deploy_packer

deploy_packer(name, target)

Execute Packer to perform deployment

Attributes

name Name; required

A unique name for this target.

target Label; optional

`assemble_packer` label to be deployed.

deploy_pip

deploy_pip(name, deployment_properties, target)

Attributes

name Name; required

A unique name for this target.

deployment_properties Label; required

File containing Python pip repository url by `repo.pypi` key

target Label; required

`assemble_pip` label to be included in the package

deploy_rpm

deploy_rpm(name, deployment_properties, target)

Deploy package built with assemble_rpm to RPM repository

Attributes

name Name; required

A unique name for this target.

deployment_properties Label; required

Properties file containing repo.rpm.(snapshot|release) key

target Label; optional

`assemble_rpm` target to deploy

generate_json_config

generate_json_config(name, substitutions, template)

Fills in JSON template with provided values

Attributes

name Name; required

A unique name for this target.

substitutions Dictionary: String -> String; optional

Values to fill in

template Label; optional

JSON template to fill in values

java_deps

java_deps(name, java_deps_root, maven_name, target, version_file)

Packs Java library alongside with its dependencies into archive

Attributes

name Name; required

A unique name for this target.

java_deps_root String; optional

Folder inside archive to put JARs into

maven_name Boolean; optional

Name JAR files inside archive based on Maven coordinates

target Label; required

Java target to pack into archive

version_file Label; optional

File containing version string. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version at all defaults to '0.0.0'

pkg_deb

pkg_deb(name, architecture, built_using, built_using_file, conffiles, conffiles_file, config, conflicts, data, depends, depends_file, description, description_file, distribution, enhances, homepage, maintainer, make_deb, package, postinst, postrm, predepends, preinst, prerm, priority, recommends, section, suggests, templates, urgency, version, version_file)

Attributes

name Name; required

A unique name for this target.

architecture String; optional
built_using String; optional
built_using_file Label; optional
conffiles List of strings; optional
conffiles_file Label; optional
config Label; optional
conflicts List of strings; optional
data Label; required
depends List of strings; optional
depends_file Label; optional
description String; optional
description_file Label; optional
distribution String; optional
enhances List of strings; optional
homepage String; optional
maintainer String; required
make_deb Label; optional
package String; required
postinst Label; optional
postrm Label; optional
predepends List of strings; optional
preinst Label; optional
prerm Label; optional
priority String; optional
recommends List of strings; optional
section String; optional
suggests List of strings; optional
templates Label; optional
urgency String; optional
version String; optional
version_file Label; optional

tgz2zip

tgz2zip(name, output_filename, prefix, tgz)

Converts .tar.gz into .zip

Attributes

name Name; required

A unique name for this target.

output_filename String; required

Resulting filename

prefix String; optional

Prefix of files in archive

tgz Label; required

Input .tar.gz archive

JarToMavenCoordinatesMapping

JarToMavenCoordinatesMapping(filename, maven_coordinates)

Fields

filename

jar filename

maven_coordinates

Maven coordinates of the jar

JavaLibInfo

JavaLibInfo(target_coordinates, target_deps_coordinates)

Fields

target_coordinates

The Maven coordinates for the artifacts that are exported by this target: i.e. the target itself and its transitively exported targets.

target_deps_coordinates

The Maven coordinates of the direct dependencies, and the transitively exported targets, of this target.

MavenDeploymentInfo

MavenDeploymentInfo(jar, srcjar, pom)

Fields

jar

JAR file to deploy

srcjar

JAR file with sources

pom

Accompanying pom.xml file

MavenPomInfo

MavenPomInfo(maven_pom_deps)

Fields

maven_pom_deps

Maven coordinates for dependencies, transitively collected

TransitiveJarToMavenCoordinatesMapping

TransitiveJarToMavenCoordinatesMapping(mapping)

Fields

mapping

maps jar filename to coordinates

assemble_apt

assemble_apt(name, package_name, maintainer, description, version_file, installation_dir, workspace_refs, archives, empty_dirs, files, depends, symlinks, permissions)

Assemble package for installation with APT

Parameters

name required.

A unique name for this target.

package_name required.

Package name for built .deb package https://www.debian.org/doc/debian-policy/ch-controlfields#package

maintainer required.

The package maintainer's name and email address. The name must come first, then the email address inside angle brackets <> (in RFC822 format)

description required.

description of the built package https://www.debian.org/doc/debian-policy/ch-controlfields#description

version_file optional. default is None

File containing version number of a package. Alternatively, pass --define version=VERSION to Bazel invocation. Specifying commit SHA will result in prepending '0.0.0' to it to comply with Debian rules. Not specifying version at all defaults to '0.0.0' https://www.debian.org/doc/debian-policy/ch-controlfields#version

installation_dir optional. default is None

directory into which .deb package is unpacked at installation

workspace_refs optional. default is None

JSON file with other Bazel workspace references

archives optional. default is []

Bazel labels of archives that go into .deb package

empty_dirs optional. default is []

list of empty directories created at package installation

files optional. default is {}

mapping between Bazel labels of archives that go into .deb package and their resulting location on .deb package installation

depends optional. default is []

list of Debian packages this package depends on https://www.debian.org/doc/debian-policy/ch-relationships.htm

permissions optional. default is {}

mapping between paths and UNIX permissions

assemble_aws

assemble_aws(name, ami_name, install, region, files)

Assemble files for AWS deployment

Parameters

name required.

A unique name for this target.

ami_name required.

AMI name of deployed image

install required.

Bazel label for install file

region required.

AWS region to deploy image to

files required.

Files to include into AWS deployment

assemble_gcp

assemble_gcp(name, project_id, install, zone, image_name, image_licenses, files)

Assemble files for GCP deployment

Parameters

name required.

A unique name for this target.

project_id required.

Google project id

install required.

Bazel label for install file

zone required.

GCP zone to deploy image to

image_name required.

name of deployed image

image_licenses required.

licenses to attach to deployed image

files required.

Files to include into GCP deployment

assemble_packer

assemble_packer(name, config, files)

Assemble files for HashiCorp Packer deployment

Parameters

name required.

A unique name for this target.

config required.

Packer JSON config

files optional. default is {}

Files to include into deployment

assemble_rpm

assemble_rpm(name, package_name, spec_file, version_file, workspace_refs, installation_dir, archives, empty_dirs, files, permissions, symlinks)

Assemble package for installation with RPM

Parameters

name required.

A unique name for this target.

package_name required.

Package name for built .deb package

spec_file required.

The RPM spec file to use

version_file optional. default is None

File containing version number of a package. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version defaults to '0.0.0'

workspace_refs optional. default is None
installation_dir optional. default is None

directory into which .rpm package is unpacked at installation

archives optional. default is []

Bazel labels of archives that go into .rpm package

empty_dirs optional. default is []

list of empty directories created at package installation

files optional. default is {}

mapping between Bazel labels of archives that go into .rpm package and their resulting location on .rpm package installation

permissions optional. default is {}

mapping between paths and UNIX permissions

assemble_targz

assemble_targz(name, output_filename, targets, additional_files, empty_directories, permissions, visibility)

Assemble distribution archive (.tar.gz)

Parameters

name required.

A unique name for this target.

output_filename optional. default is None

filename of resulting archive

targets optional. default is []

Bazel labels of archives that go into .tar.gz package

additional_files optional. default is {}

mapping between Bazel labels of files that go into archive and their resulting location in archive

empty_directories optional. default is []

list of empty directories created at archive installation

permissions optional. default is {}

mapping between paths and UNIX permissions

visibility optional. default is ["//visibility:private"]

controls whether the target can be used by other packages

assemble_zip

assemble_zip(name, output_filename, targets, additional_files, empty_directories, permissions, visibility)

Assemble distribution archive (.zip)

Parameters

name required.

A unique name for this target.

output_filename required.

filename of resulting archive

targets required.

Bazel labels of archives that go into .tar.gz package

additional_files optional. default is {}

mapping between Bazel labels of files that go into archive and their resulting location in archive

empty_directories optional. default is []

list of empty directories created at archive installation

permissions optional. default is {}

mapping between paths and UNIX permissions

visibility optional. default is ["//visibility:private"]

controls whether the target can be used by other packages

You can’t perform that action at this time.