ballet.util.ci module¶
-
class
ballet.util.ci.
TravisPullRequestBuildDiffer
(repo=None)[source]¶ Bases:
ballet.util.git.PullRequestBuildDiffer
Differ from within Travis test environment
- Requires several environment variables set by Travis to work properly:
TRAVIS_BUILD_DIR, to detect the git repo
- TRAVIS_PULL_REQUEST, to determine whether the build is on a pull
request
TRAVIS_COMMIT_RANGE, to determine which commits to diff.
- Parameters
repo (
Optional
[Repo
]) – repo object for the project
-
EXPECTED_TRAVIS_ENV_VARS
= ('TRAVIS_BUILD_DIR', 'TRAVIS_PULL_REQUEST', 'TRAVIS_COMMIT_RANGE')¶
-
ballet.util.ci.
can_use_travis_differ
(repo)[source]¶ Check if the required travis env vars are set for the travis differ
- Return type
bool
-
ballet.util.ci.
get_travis_branch
()[source]¶ Get current branch per Travis environment variables
If travis is building a PR, then TRAVIS_PULL_REQUEST is truthy and the name of the branch corresponding to the PR is stored in the TRAVIS_PULL_REQUEST_BRANCH environment variable. Else, the name of the branch is stored in the TRAVIS_BRANCH environment variable.
- Return type
Optional
[str
]