]>
jfr.im git - irc/kvirc/KVIrc.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 kvirc/KVIrc to kvirc/coverity no more than once a day, with modified .travis.yml
6 # This script is shamelessly copied from znc/znc (I wrote that one first), but please keep them synchronized...
13 subprocess
.check_call(['git remote add coverity github:kvirc/coverity.git'], shell
=True)
14 subprocess
.check_call(['git fetch coverity'], shell
=True)
15 commits_today
= subprocess
.check_output(['git log --since=today.midnight --oneline coverity/coverity_scan || true'], shell
=True)
16 if len(commits_today
) > 0:
17 print('There were already commits today in coverity_scan')
20 # Get "install:" from .travis.yml, the rest from .travis-coverity.yml
21 with open('.travis.yml') as f
:
23 with open('.travis-coverity.yml') as f
:
25 # Travis project of kvirc/coverity is not multi-os
26 c
['install'] = ['export TRAVIS_OS_NAME=linux'] + t
['install']
28 with open('.travis.yml', 'w') as f
:
29 print(yaml
.dump(c
, default_flow_style
=False), file=f
)
31 subprocess
.check_call(['git checkout -b coverity_scan'], shell
=True)
32 subprocess
.check_call(['git commit .travis.yml -m"Automatic coverity scan for {}"'.format(datetime
.date
.today())], shell
=True)
33 subprocess
.check_call(['git push coverity coverity_scan -f'], shell
=True)