workspace_assert_member_revision()
def workspace_assert_member_revision(url, rev)Checks if the workspace satifies a requirement
Args
url: string: The url of the workspace memberrev: string: git/sha256 hash
workspace_assert_member_semver()
def workspace_assert_member_semver(url, semver)Fails if the workspace does not satifies a requirement
Args
url: string: The url of the workspace membersemver: string: The semver requiement assuming the member has a version
workspace_check_member_revision()
def workspace_check_member_revision(url, rev) -> boolChecks if the workspace satifies a requirement
Args
url: string: The url of the workspace memberrev: string: git/sha256 hash
Returns
True if the workspace member is found at the specified rev, False otherwise
workspace_check_member_semver()
def workspace_check_member_semver(url, semver) -> boolChecks if the workspace satifies a requirement
Args
url: string: The url of the workspace membersemver: string: The semver requiement assuming the member has a version
Returns
True if the workspace member is found satisfying semver, False otherwise
workspace_get_absolute_path()
def workspace_get_absolute_path() -> stringGet the absolute path to the workspace
Returns
The absolute path to the workspace
workspace_get_build_archive_info()
def workspace_get_build_archive_info(name, archive) -> dictGets the archive info the specified rule and archive
Args
name: string: rule name to get info forarchive: dict: archive object containing details of how to create the archive
Returns
The archive info
workspace_get_cpu_count()
def workspace_get_cpu_count() -> intGet the number of CPUs available
Use info_get_cpu_count(). This will be removed in a future release.
Returns
The number of CPUs available
workspace_get_env_var()
def workspace_get_env_var(name) -> stringGet the value of an environment variable
Args
name: string: The name of the environment variable
Returns
The value of the environment variable
workspace_get_env_var_or()
def workspace_get_env_var_or(name, or_value) -> stringGet the value of an environment variable if it exists.
Otherwise, the value passed to or_value is returned.
Args
name: string: The name of the environment variableor_value: string: Other value to return
Returns
If available, the value of the environment variable, otherwise or_value
workspace_get_env_var_or_none()
def workspace_get_env_var_or_none(name)Get the value of an environment variable if it exists. Otherwise, return None
Args
name: string: The name of the environment variable
Returns
If available, the value of the environment variable, otherwise None
workspace_get_path_to_checkout()
def workspace_get_path_to_checkout() -> stringGet the path in the workspace where the current module is located
Returns
The path to the checked out repo or archive
workspace_get_path_to_log_file()
def workspace_get_path_to_log_file(name) -> stringGets the path to the log file for a given target.
The log file location changes on every run. Calling this will
effectively call workspace_set_always_evaluate(True) because
the log path location changes with every run.
Args
name: string: The name of the rule
Returns
The relative workspace path to the log file
workspace_get_path_to_member()
def workspace_get_path_to_member(url, rev, semver) -> stringGets the path in the workspace to a member pulled from url
If the member is not found, the program will exit with an error.
It is an error to specify rev and semver.
Args
url: string: The url of the workspace memberrev: The revision of the workspace member (or None for any revision)semver: The semantic version of the workspace member (or None for any version)
Returns
The path to the workspace member.
workspace_get_path_to_member_or_none()
def workspace_get_path_to_member_or_none(url, rev, semver)Gets the path in the workspace to a member pulled from url
If the member is not found, returns None.
It is an error to specify rev and semver.
Args
url: string: The url of the workspace memberrev: The revision of the workspace member (or None for any revision)semver: The semantic version of the workspace member (or None for any version)
Returns
The path to the workspace member or None if not found.
workspace_get_path_to_member_with_rev()
def workspace_get_path_to_member_with_rev(url, rev) -> stringGets the path to a workspace member with the specified revision.
If the the specified requirement is not found, the program will exit with an error.
Args
url: string: The url of the workspace memberrev: string: the git or sha256 hash
Returns
The path to the workspace member.
workspace_get_path_to_member_with_semver()
def workspace_get_path_to_member_with_semver(url, semver) -> stringGet the path to a workspace member.
If the the specified requirement is not found, the program will exit with an error. Not all workspace members have versions. The version is set manually during checkout or pulled from the git rev (tag).
Args
url: string: The url of the workspace membersemver: string: The semver requiement assuming the member has a version
Returns
The path to the workspace member.
workspace_is_env_var_set()
def workspace_is_env_var_set(name) -> boolCheck if an environment variable is set
Args
name: string: The name of the environment variable
Returns
True if the environment variable is set, False otherwise
workspace_is_env_var_set_to()
def workspace_is_env_var_set_to(name, expected) -> boolReturns true if an env variable is set to the expected value.
Returns false if the env either does not exist or is not set to the expected value.
Args
name: string: The name of the environment variableexpected: string: The expected value stored in the env variable
workspace_is_path_to_member_available()
def workspace_is_path_to_member_available(url, rev, semver) -> boolChecks if a workspace member is available based on a url.
It is an error to specify rev and semver.
Args
url: string: The url of the workspace memberrev: The revision of the workspace member (or None for any revision)semver: The semantic version of the workspace member (or None for any version)
Returns
True if the member is available, False otherwise.
workspace_is_reproducible()
def workspace_is_reproducible() -> boolCheck if the workspace is reproducible
If any repos are on a branch rather than a commit, this will return False.
Use a lock file (see --create-lock-file) to ensure reproducibility.
Returns
True if the workspace is reproducible, False otherwise
workspace_load_value()
def workspace_load_value(name)Loads a value stored using checkout_store_value().
Args
name: string: The key to load the value under.
Returns
The stored value, or None if no value is stored under the key.
workspace_set_always_evaluate()
def workspace_set_always_evaluate(value)Set the always evaluate flag for the workspace.
This will prevent spaces from skipping the evaluation phase when running rules in the workspace.
Args
value: bool: