README.md

January 13, 2024 ยท View on GitHub

assemble_crate

assemble_crate(name, authors, categories, crate_features, description, documentation, homepage,
               keywords, license, license_file, readme_file, repository, target, universe_manifests,
               version_file, workspace_refs)

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
authorsProject authorsList of stringsoptional[]
categoriesProject categoriesList of stringsoptional[]
crate_featuresAvailable features in the crate, in format similar to the cargo features format.Dictionary: String -> List of stringsoptional{}
descriptionThe description is a short blurb about the package. crates.io will display this with your package. This should be plain text (not Markdown). https://doc.rust-lang.org/cargo/reference/manifest.html#the-description-fieldStringrequired
documentationLink to documentation of the projectStringoptional""
homepageLink to homepage of the projectStringrequired
keywordsThe keywords field is an array of strings that describe this package. This can help when searching for the package on a registry, and you may choose any words that would help someone find this crate.

Note: crates.io has a maximum of 5 keywords. Each keyword must be ASCII text, start with a letter, and only contain letters, numbers, _ or -, and have at most 20 characters.

https://doc.rust-lang.org/cargo/reference/manifest.html#the-keywords-field
List of stringsoptional[]
licenseThe license field contains the name of the software license that the package is released under. https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fieldsStringrequired
license_fileLicense file for the crate.LabeloptionalNone
readme_fileREADME of the projectLabeloptionalNone
repositoryRepository of the projectStringrequired
targetrust_library label to be included in the packageLabelrequired
universe_manifestsThe Cargo manifests used by crates_universe to generate Bazel targets for crates.io dependencies.

These manifests serve as the source of truth for emitting dependency configuration in the assembled crate, such as explicitly requested features and the exact version requirement.
List of labelsoptional[]
version_fileFile containing version string. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version at all defaults to '0.0.0'LabeloptionalNone
workspace_refsJSON file describing dependencies to other Bazel workspacesLabeloptionalNone

assemble_maven

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

Assemble Java package for subsequent deployment to Maven repo

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
developersProject developers to fill into pom.xmlDictionary: String -> List of stringsoptional{}
licenseProject license to fill into pom.xmlStringoptional"apache"
platform_overridesPer-platform overrides for a dependency. Expects a dict of bazel labels to a JSON-encoded list of maven coordinates. Ex.: assemble_maven( ... platform_overrides = { ":bazel-dependency": json.encode([ "org.company:dependency-windows-x86_64:{pom_version}", "org.company:dependency-linux-aarch64:{pom_version}", "org.company:dependency-linux-x86_64:{pom_version}", "org.company:dependency-macosx-aarch64:{pom_version}", "org.company:dependency-macosx-x86_64:{pom_version}", ]) } )Dictionary: Label -> Stringoptional{}
project_descriptionProject description to fill into pom.xmlStringoptional"PROJECT_DESCRIPTION"
project_nameProject name to fill into pom.xmlStringoptional"PROJECT_NAME"
project_urlProject URL to fill into pom.xmlStringoptional"PROJECT_URL"
scm_urlProject source control URL to fill into pom.xmlStringoptional"PROJECT_URL"
targetJava target for subsequent deploymentLabelrequired
version_fileFile containing version string. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version at all defaults to '0.0.0'LabeloptionalNone
version_overridesDictionary of maven artifact : version to pin artifact versions toDictionary: String -> Stringoptional{}
workspace_refsJSON file describing dependencies to other Bazel workspacesLabeloptionalNone

assemble_npm

assemble_npm(name, target, version_file)

Assemble npm_package target for further deployment. Currently does not support remote execution (RBE).

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
targetnpm_library label to be included in the package.Labelrequired
version_fileFile containing version string. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version at all defaults to '0.0.0'.LabeloptionalNone

assemble_pip

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

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
authorDetails about the authorStringrequired
author_emailThe email for the authorStringrequired
classifiersA list of strings, containing Python package classifiersList of stringsrequired
descriptionA string with the short description of the packageStringrequired
keywordsA list of strings, containing keywordsList of stringsrequired
licenseThe type of license to useStringrequired
long_description_fileA label with the long description of the package. Usually a README or README.rst fileLabelrequired
package_nameA string with Python pip package nameStringrequired
python_requiresIf your project only runs on certain Python versions, setting the python_requires argument to the appropriate PEP 440 version specifier string will prevent pip from installing the project on other Python versions.Stringoptional">0"
requirements_fileA file with the list of required packages for this oneLabelrequired
suffixA suffix that has to be removed from the filenamesStringoptional""
targetpy_library label to be included in the packageLabelrequired
urlA homepage for the projectStringrequired
version_fileFile containing version string. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version at all defaults to '0.0.0'LabeloptionalNone

assemble_versioned

assemble_versioned(name, targets, version_file)

Version multiple archives for subsequent simultaneous deployment

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
targetsArchives to version and put into output archiveList of labelsoptional[]
version_fileFile containing version stringLabeloptionalNone

checksum

checksum(name, archive)

Computes SHA256 checksum of file

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
archiveArchive to compute checksum ofLabelrequired

deploy_apt

deploy_apt(name, release, snapshot, target)

Deploy package built with assemble_apt to APT repository.

Select deployment to `snapshot` or `release` repository with `bazel run //:some-deploy-apt -- [snapshot|release]

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
releaseRelease repository to deploy apt artifact toStringrequired
snapshotSnapshot repository to deploy apt artifact toStringrequired
targetassemble_apt label to deployLabeloptionalNone

deploy_brew

deploy_brew(name, file_substitutions, formula, release, snapshot, type, version_file)

Deploy Homebrew (Caskroom) formula to Homebrew tap.

Select deployment to `snapshot` or `release` repository with `bazel run //:some-deploy-brew -- [snapshot|release]

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
file_substitutionsSubstitute file contents into the formula. Key: file to read the substitution from. Value: placeholder in the formula template to substitute.Dictionary: Label -> Stringoptional{}
formulaThe brew formula definitionLabelrequired
releaseRelease repository to deploy brew artifact toStringrequired
snapshotSnapshot repository to deploy brew artifact toStringrequired
typeType of deployment (Homebrew/Caskroom). Cask is generally used for graphic applicationsStringoptional"brew"
version_fileFile containing version string. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version at all defaults to '0.0.0'LabeloptionalNone

deploy_crate

deploy_crate(name, release, snapshot, target)

Deploy assemble_crate target into Crate repo

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
releaseRelease repository to release Crate artifact toStringrequired
snapshotSnapshot repository to release Crate artifact toStringrequired
targetassemble_crate target to deployLabelrequired

deploy_github

deploy_github(name, archive, draft, organisation, release_description, repository, title,
              title_append_version, version_file)

Deploy assemble_versioned target to GitHub Releases

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
archiveassemble_versioned label to be deployed.LabeloptionalNone
draftCreates an unpublished / draft release when set to True. Defaults to True.BooleanoptionalTrue
organisationGithub organisation to deploy toStringrequired
release_descriptionDescription of GitHub releaseLabeloptionalNone
repositoryGithub repository to deploy to within organisationStringrequired
titleTitle of GitHub releaseStringoptional""
title_append_versionAppend version to GitHub release titleBooleanoptionalFalse
version_fileFile containing version string. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version at all defaults to '0.0.0'LabeloptionalNone

deploy_npm

deploy_npm(name, release, snapshot, target)
Deploy `assemble_npm` target into npm registry using token authentication.

Select deployment to `snapshot` or `release` repository with `bazel run //:some-deploy-npm -- [snapshot|release]

## How to generate an auth token

### Using the command line (`npm adduser`)
1. Run `npm adduser <repo_url>` (example: `npm adduser --registry=https://npm.cloudsmith.io/typedb/private/`)
2. When prompted, provide login credentials to sign in to the user account that is used in your CI and has permissions to publish the package
3. If successful, a line will be added to your `.npmrc` file (`$HOME/.npmrc` on Unix) which looks like: `//npm.cloudsmith.io/typedb/private/:_authToken=NpmToken.00000000-0000-0000-0000-000000000000`. The token is the value of `_authToken`, in this case `NpmToken.00000000-0000-0000-0000-000000000000`.
4. Save the auth token somewhere safe and then delete it from your `.npmrc` file

### Using a UI

Some remote repository managers (e.g. the `npm` registry, https://npmjs.com) provide a UI to create auth tokens.

#### `npm` registry (`npmjs.com`)

1. Sign in to the user account at https://npmjs.com that is used in your CI and has permissions to publish the package
2. Navigate to the account's "Access Tokens", generate a new one and store it somewhere safe

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
releaseRelease repository to deploy npm artifact to.Stringrequired
snapshotSnapshot repository to deploy npm artifact to.Stringrequired
targetassemble_npm target to be included in the package.Labelrequired

deploy_packer

deploy_packer(name, overwrite, target)

Execute Packer to perform deployment

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
overwriteOverwrite already-existing imageBooleanoptionalFalse
targetassemble_packer label to be deployed.LabeloptionalNone

doxygen_docs

doxygen_docs(name, desc, main_page_md, project_name, sources, strip_prefix, version)
    Creates HTML documentation for C++ projects using Doxygen.
    

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
descA description for the projectStringoptional""
main_page_mdThe file to use as main page for the generate docsLabeloptionalNone
project_nameThe project name for the doxygen docsStringrequired
sourcesA list of files made available to doxygen. This is NOT automatically included in the doxyfileList of labelsrequired
strip_prefixPrefix to strip from path of files being processedStringoptional""
versionThe version of the project being documentedStringoptional""

generate_json_config

generate_json_config(name, substitutions, template)

Fills in JSON template with provided values

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
substitutionsValues to fill inDictionary: String -> Stringoptional{}
templateJSON template to fill in valuesLabeloptionalNone

java_deps

java_deps(name, allowed_conflicting_jars, ignore_missing_maven_name, java_deps_root,
          java_deps_root_overrides, maven_name, target, version_file)

Packs Java library alongside with its dependencies into archive

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
allowed_conflicting_jarsList of allowed JAR names that can conflict (ie. the same JAR name produced by two different dependencies).List of stringsoptional[]
ignore_missing_maven_nameDon't fail if bundling using maven names when encountering a target that is missing a maven nameBooleanoptionalFalse
java_deps_rootFolder inside archive to put JARs intoStringoptional""
java_deps_root_overridesJARs with filenames matching the given patterns will be placed into the specified folders inside the archive, instead of the default folder. Patterns can be either the full name of a JAR, or a prefix followed by a '*'.Dictionary: String -> Stringoptional{}
maven_nameName JAR files inside archive based on Maven coordinatesBooleanoptionalFalse
targetJava target to pack into archiveLabelrequired
version_fileFile containing version string. Alternatively, pass --define version=VERSION to Bazel invocation. Not specifying version at all defaults to '0.0.0'LabeloptionalNone

sphinx_docs

sphinx_docs(name, out, package_subdir, sphinx_conf, sphinx_rst, target)
    Creates an HTML documentation for python module using Sphinx.
    

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
outOutput directoryLabelrequired
package_subdirDirectory with the module files in the package archiveStringrequired
sphinx_confConfiguration file for the Sphinx documentation builderLabelrequired
sphinx_rstSphinx documentation master file for the packageLabelrequired
targetPackage including .tar.gz archiveLabelrequired

tgz2zip

tgz2zip(name, output_filename, tgz)

Converts .tar.gz into .zip

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
output_filenameResulting filenameStringrequired
tgzInput .tar.gz archiveLabelrequired

JarToMavenCoordinatesMapping

JarToMavenCoordinatesMapping(filename, maven_coordinates)

FIELDS

NameDescription
filenamejar filename
maven_coordinatesMaven coordinates of the jar

MavenDeploymentInfo

MavenDeploymentInfo(jar, srcjar, pom)

FIELDS

NameDescription
jarJAR file to deploy
srcjarJAR file with sources
pomAccompanying pom.xml file

TransitiveJarToMavenCoordinatesMapping

TransitiveJarToMavenCoordinatesMapping(mapping)

FIELDS

NameDescription
mappingmaps jar filename to coordinates

assemble_apt

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

Assemble package for installation with APT

PARAMETERS

NameDescriptionDefault Value
nameA unique name for this target.none
package_namePackage name for built .deb package https://www.debian.org/doc/debian-policy/ch-controlfields#packagenone
maintainerThe package maintainer's name and email address. The name must come first, then the email address inside angle brackets <> (in RFC822 format)none
descriptiondescription of the built package https://www.debian.org/doc/debian-policy/ch-controlfields#descriptionnone
version_fileFile 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#versionNone
installation_dirdirectory into which .deb package is unpacked at installationNone
workspace_refsJSON file with other Bazel workspace referencesNone
archivesBazel labels of archives that go into .deb package[]
empty_dirslist of empty directories created at package installation[]
empty_dirs_permissionUNIXy permission for the empty directories to be created"0777"
filesmapping between Bazel labels of archives that go into .deb package and their resulting location on .deb package installation{}
dependslist of Debian packages this package depends on https://www.debian.org/doc/debian-policy/ch-relationships.htm[]
symlinksmapping between source and target of symbolic links created at installation{}
permissionsmapping between paths and UNIXy permissions{}
architecturepackage architecture (default option: 'all', common other options: 'amd64', 'arm64')"all"
target_compatible_with

-

[]

assemble_aws

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

Assemble files for AWS deployment

PARAMETERS

NameDescriptionDefault Value
nameA unique name for this target.none
ami_nameAMI name of deployed imagenone
installBazel label for install filenone
regionAWS region to deploy image tonone
filesFiles to include into AWS deploymentnone

assemble_azure

assemble_azure(name, image_name, resource_group_name, install, image_publisher, image_offer,
               image_sku, disk_size_gb, files)

Assemble files for Azure deployment

PARAMETERS

NameDescriptionDefault Value
nameA unique name for this target.none
image_namename of deployed imagenone
resource_group_namename of the resource group to place image innone
installBazel label for install filenone
image_publisherPublisher of the image used as base"Canonical"
image_offerOffer of the image used as base"0001-com-ubuntu-server-focal"
image_skuSKU of the image used as base"20_04-lts"
disk_size_gbSize of the resulting OS disk60
filesFiles to include into Azure deploymentNone

assemble_gcp

assemble_gcp(name, project_id, install, zone, image_name, image_family, files, image_licenses,
             disable_default_service_account, source_image_family)

Assemble files for GCP deployment

PARAMETERS

NameDescriptionDefault Value
nameA unique name for this target.none
project_idGoogle project idnone
installBazel label for install filenone
zoneGCP zone to deploy image tonone
image_namename of deployed imagenone
image_familyfamily of deployed image""
filesFiles to include into GCP deploymentNone
image_licenseslicenses to attach to deployed imageNone
disable_default_service_accountdisable default service accountFalse
source_image_familyFamily of GCP base image"ubuntu-1604-lts"

assemble_packer

assemble_packer(name, config, files)

Assemble files for HashiCorp Packer deployment

PARAMETERS

NameDescriptionDefault Value
nameA unique name for this target.none
configPacker JSON confignone
filesFiles to include into deployment{}

assemble_targz

assemble_targz(name, output_filename, targets, additional_files, empty_directories, permissions,
               append_version, visibility, tags, target_compatible_with)

Assemble distribution archive (.tar.gz)

PARAMETERS

NameDescriptionDefault Value
nameA unique name for this target.none
output_filenamefilename of resulting archiveNone
targetsBazel labels of archives that go into .tar.gz package[]
additional_filesmapping between Bazel labels of files that go into archive and their resulting location in archive{}
empty_directorieslist of empty directories created at archive installation[]
permissionsmapping between paths and UNIX permissions{}
append_versionappend version to root folder inside the archiveTrue
visibilitycontrols whether the target can be used by other packages["//visibility:private"]
tags

-

[]
target_compatible_with

-

[]

assemble_zip

assemble_zip(name, output_filename, targets, additional_files, empty_directories, permissions,
             append_version, visibility, tags, target_compatible_with)

Assemble distribution archive (.zip)

PARAMETERS

NameDescriptionDefault Value
nameA unique name for this target.none
output_filenamefilename of resulting archivenone
targetsBazel labels of archives that go into .tar.gz package[]
additional_filesmapping between Bazel labels of files that go into archive and their resulting location in archive{}
empty_directorieslist of empty directories created at archive installation[]
permissionsmapping between paths and UNIX permissions{}
append_versionappend version to root folder inside the archiveTrue
visibilitycontrols whether the target can be used by other packages["//visibility:private"]
tags

-

[]
target_compatible_with

-

[]

deploy_maven

deploy_maven(name, target, snapshot, release, kwargs)

PARAMETERS

NameDescriptionDefault Value
name

-

none
target

-

none
snapshot

-

none
release

-

none
kwargs

-

none

deploy_pip

deploy_pip(name, target, snapshot, release, suffix, distribution_tag)

PARAMETERS

NameDescriptionDefault Value
name

-

none
target

-

none
snapshot

-

none
release

-

none
suffix

-

""
distribution_tag

-

"py3-none-any"