diff --git a/README.md b/README.md index 689f1bd..cdcb27c 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Inspired from [z4r/python-coveralls](https://github.com/z4r/python-coveralls), i - `COVERALLS_REPO_TOKEN` - `COVERALLS_ENDPOINT` - `COVERALLS_PARALLEL` +- `COVERALLS_SERVICE_NAME` ## Usage: diff --git a/cpp_coveralls/__init__.py b/cpp_coveralls/__init__.py index c3d0e4e..f62ebf1 100644 --- a/cpp_coveralls/__init__.py +++ b/cpp_coveralls/__init__.py @@ -1,3 +1,4 @@ +# THIS FILE HAS BEEN MODIFIED BY D7919 from __future__ import absolute_import from __future__ import print_function @@ -73,7 +74,9 @@ def run(): # use environment COVERALLS_REPO_TOKEN as a fallback args.repo_token = os.environ.get('COVERALLS_REPO_TOKEN') - args.service_name = yml.get('service_name', 'travis-ci') + args.service_name = yml.get('service_name', + os.environ.get('COVERALLS_SERVICE_NAME', + 'travis-ci')) if not args.gcov_options: args.gcov_options = yml.get('gcov_options', '') @@ -86,7 +89,9 @@ def run(): args.include.extend(yml.get('include', [])) args.exclude_lines_pattern.extend(yml.get('exclude_lines_pattern', [])) - args.service_job_id = os.environ.get('TRAVIS_JOB_ID', '') + args.service_job_id = os.environ.get('TRAVIS_JOB_ID', + os.environ.get('CI_PIPELINE_ID', + '')) if args.repo_token == '' and args.service_job_id == '': raise ValueError("\nno coveralls.io token specified and no travis job id found\n" diff --git a/cpp_coveralls/gitrepo.py b/cpp_coveralls/gitrepo.py index b7e09e2..b431070 100644 --- a/cpp_coveralls/gitrepo.py +++ b/cpp_coveralls/gitrepo.py @@ -1,3 +1,5 @@ +# THIS FILE HAS BEEN MODIFIED BY D7919 + from __future__ import absolute_import import os @@ -43,7 +45,8 @@ def gitrepo(cwd): }, 'branch': os.environ.get('TRAVIS_BRANCH', os.environ.get('APPVEYOR_REPO_BRANCH', - repo.git('rev-parse', '--abbrev-ref', 'HEAD')[1].strip())), + os.environ.get('CI_COMMIT_BRANCH', + repo.git('rev-parse', '--abbrev-ref', 'HEAD')[1].strip()))), 'remotes': [{'name': line.split()[0], 'url': line.split()[1]} for line in repo.git('remote', '-v')[1] if '(fetch)' in line] }