mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
![Tianon Gravi](/assets/img/avatar_default.png)
After each push, Travis CI will trigger, and check two things: - make sure that each commit in the push has the Docker certificate of origin - make sure that all .go files changed by this sequence of commits are correctly formatted in the most recent commit Note: there is one edge case; if you do a git force push, we cannot figure out the actual commits in the force push, and we will just run the checks as if upstream master were the base. Pull requests will always be tested correctly, though. Docker-DCO-1.0-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
21 lines
830 B
Python
21 lines
830 B
Python
import os
|
|
import subprocess
|
|
|
|
if 'TRAVIS' not in os.environ:
|
|
print 'TRAVIS is not defined; this should run in TRAVIS. Sorry.'
|
|
exit(127)
|
|
|
|
if os.environ['TRAVIS_PULL_REQUEST'] != 'false':
|
|
commit_range = [os.environ['TRAVIS_BRANCH'], 'FETCH_HEAD']
|
|
else:
|
|
try:
|
|
subprocess.check_call([
|
|
'git', 'log', '-1', '--format=format:',
|
|
os.environ['TRAVIS_COMMIT_RANGE'], '--',
|
|
])
|
|
commit_range = os.environ['TRAVIS_COMMIT_RANGE'].split('...')
|
|
if len(commit_range) == 1: # if it didn't split, it must have been separated by '..' instead
|
|
commit_range = commit_range[0].split('..')
|
|
except subprocess.CalledProcessError:
|
|
print 'TRAVIS_COMMIT_RANGE is invalid. This seems to be a force push. We will just assume it must be against upstream master and compare all commits in between.'
|
|
commit_range = ['upstream/master', 'HEAD']
|