diff options
author | rghetia <rghetia@yahoo.com> | 2018-05-16 09:45:53 -0700 |
---|---|---|
committer | rghetia <rghetia@yahoo.com> | 2018-05-23 09:38:53 -0700 |
commit | 9f1a1bef457267ed789687b27b7340c9951ddb1a (patch) | |
tree | 9d32751579ba5cfa91032efd091f48b741b60bae /scripts | |
parent | a3b50ea4e27b0edbc976f10741fc3f4c14f7e9bc (diff) | |
download | opencensus-java-9f1a1bef457267ed789687b27b7340c9951ddb1a.tar.gz |
To bring parity with travis build add missing tasks to kokoro build.
- Each task is treated as separate job to run in parallel.
- single script linux_presumbit.sh performs all task based TASK env.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/check-git-history.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/check-git-history.py b/scripts/check-git-history.py index 1aba2ca2..df13e423 100644 --- a/scripts/check-git-history.py +++ b/scripts/check-git-history.py @@ -4,7 +4,8 @@ import traceback def main(argv): # Only check the history if the build is running on a pull request. - if is_travis_pull_request(): + # Build could be running on pull request using travis or kokoro. + if is_travis_pull_request() or is_kokoro_presubmit_request(): # This function assumes that HEAD^1 is the base branch and HEAD^2 is the # pull request. exit_if_pull_request_has_merge_commits() @@ -12,9 +13,17 @@ def main(argv): else: print 'Skipped history check.' +def is_kokoro_presubmit_request(): + '''Returns true if KOKORO_GITHUB_PULL_REQUEST_NUMBER is set.''' + if 'KOKORO_GITHUB_PULL_REQUEST_NUMBER' in os.environ: + return True + return False + def is_travis_pull_request(): '''Returns true if TRAVIS_PULL_REQUEST is set to indicate a pull request.''' - return os.environ['TRAVIS_PULL_REQUEST'] != 'false' + if 'TRAVIS_PULL_REQUEST' in os.environ: + return os.environ['TRAVIS_PULL_REQUEST'] != 'false' + return False def exit_if_pull_request_has_merge_commits(): '''Exits with an error if any of the commits added by the pull request are |