git_repository

git_repository(name, branch, commit, init_submodules, patch_args, patch_cmds, patch_tool, patches, remote, shallow_since, strip_prefix, tag, verbose)

Clone an external git repository.

Clones a Git repository, checks out the specified tag, or commit, and makes its targets available for binding. Also determine the id of the commit actually checked out and its date, and return a dict with parameters that provide a reproducible version of this rule (which a tag not necessarily is).

Attributes

name Name; required

A unique name for this repository.

branch String; optional

branch in the remote repository to checked out. Precisely one of branch, tag, or commit must be specified.

commit String; optional

specific commit to be checked out. Precisely one of branch, tag, or commit must be specified.

init_submodules Boolean; optional

Whether to clone submodules in the repository.

patch_args List of strings; optional

The arguments given to the patch tool

patch_cmds List of strings; optional

Sequence of commands to be applied after patches are applied.

patch_tool String; optional

The patch(1) utility to use.

patches List of labels; optional

A list of files that are to be applied as patches afer extracting the archive.

remote String; required

The URI of the remote Git repository

shallow_since String; optional

an optional date, not after the specified commit; the argument is not allowed if a tag is specified (which allows cloning with depth 1). Setting such a date close to the specified commit allows for a more shallow clone of the repository, saving bandwidth and wall-clock time.

strip_prefix String; optional

A directory prefix to strip from the extracted files.

tag String; optional

tag in the remote repository to checked out. Precisely one of branch, tag, or commit must be specified.

verbose Boolean; optional

new_git_repository

new_git_repository(name, branch, build_file, build_file_content, commit, init_submodules, patch_args, patch_cmds, patch_tool, patches, remote, shallow_since, strip_prefix, tag, verbose, workspace_file, workspace_file_content)

Clone an external git repository.

Clones a Git repository, checks out the specified tag, or commit, and makes its targets available for binding. Also determine the id of the commit actually checked out and its date, and return a dict with parameters that provide a reproducible version of this rule (which a tag not necessarily is).

Attributes

name Name; required

A unique name for this repository.

branch String; optional

branch in the remote repository to checked out. Precisely one of branch, tag, or commit must be specified.

build_file Label; optional

The file to use as the BUILD file for this repository.This attribute is an absolute label (use '@//' for the main repo). The file does not need to be named BUILD, but can be (something like BUILD.new-repo-name may work well for distinguishing it from the repository's actual BUILD files. Either build_file or build_file_content must be specified.

build_file_content String; optional

The content for the BUILD file for this repository. Either build_file or build_file_content must be specified.

commit String; optional

specific commit to be checked out. Precisely one of branch, tag, or commit must be specified.

init_submodules Boolean; optional

Whether to clone submodules in the repository.

patch_args List of strings; optional

The arguments given to the patch tool

patch_cmds List of strings; optional

Sequence of commands to be applied after patches are applied.

patch_tool String; optional

The patch(1) utility to use.

patches List of labels; optional

A list of files that are to be applied as patches afer extracting the archive.

remote String; required

The URI of the remote Git repository

shallow_since String; optional

an optional date, not after the specified commit; the argument is not allowed if a tag is specified (which allows cloning with depth 1). Setting such a date close to the specified commit allows for a more shallow clone of the repository, saving bandwidth and wall-clock time.

strip_prefix String; optional

A directory prefix to strip from the extracted files.

tag String; optional

tag in the remote repository to checked out. Precisely one of branch, tag, or commit must be specified.

verbose Boolean; optional
workspace_file Label; optional

The file to use as the `WORKSPACE` file for this repository. Either `workspace_file` or `workspace_file_content` can be specified, or neither, but not both.

workspace_file_content String; optional

The content for the WORKSPACE file for this repository. Either `workspace_file` or `workspace_file_content` can be specified, or neither, but not both.