]>
jfr.im git - irc/znc/coverity.git/blob - .travis-coverity-scan.py
3 # https://scan.coverity.com/faq#frequency doesn't allow every push to be scanned.
4 # So this script pushes znc/znc to znc/coverity no more than once a day, with modified .travis.yml
11 subprocess
.check_call(['git remote add coverity github:znc/coverity.git'], shell
=True)
12 subprocess
.check_call(['git fetch coverity'], shell
=True)
13 commits_today
= subprocess
.check_output(['git log --since=today.midnight --oneline coverity/coverity_scan || true'], shell
=True)
14 if len(commits_today
) > 0:
15 print('There were already commits today in coverity_scan')
18 # Get "install:" from .travis.yml, the rest from .travis-coverity.yml
19 with open('.travis.yml') as f
:
21 with open('.travis-coverity.yml') as f
:
23 # Travis project of znc/coverity is not multi-os
24 c
['install'] = ['export TRAVIS_OS_NAME=linux'] + t
['install']
26 with open('.travis.yml', 'w') as f
:
27 print(yaml
.dump(c
, default_flow_style
=False), file=f
)
29 subprocess
.check_call(['git checkout -b coverity_scan'], shell
=True)
30 subprocess
.check_call(['git commit .travis.yml -m"Automatic coverity scan for {}"'.format(datetime
.date
.today())], shell
=True)
31 subprocess
.check_call(['git push coverity coverity_scan -f'], shell
=True)
32 subprocess
.call(['git push coverity master'], shell
=True)