]> jfr.im git - irc/znc/znc.git/blame - .travis-coverity-scan.py
Update translations from Crowdin for de_DE es_ES pt_BR
[irc/znc/znc.git] / .travis-coverity-scan.py
CommitLineData
96d9651e
AS
1#!/usr/bin/python3
2
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
5
6import datetime
7import subprocess
8import sys
9import yaml
10
11subprocess.check_call(['git remote add coverity github:znc/coverity.git'], shell=True)
12subprocess.check_call(['git fetch coverity'], shell=True)
13commits_today = subprocess.check_output(['git log --since=today.midnight --oneline coverity/coverity_scan || true'], shell=True)
14if len(commits_today) > 0:
15 print('There were already commits today in coverity_scan')
16 sys.exit()
17
18# Get "install:" from .travis.yml, the rest from .travis-coverity.yml
19with open('.travis.yml') as f:
20 t = yaml.load(f)
21with open('.travis-coverity.yml') as f:
22 c = yaml.load(f)
23# Travis project of znc/coverity is not multi-os
24c['install'] = ['export TRAVIS_OS_NAME=linux'] + t['install']
25
26with open('.travis.yml', 'w') as f:
27 print(yaml.dump(c, default_flow_style=False), file=f)
28
29subprocess.check_call(['git checkout -b coverity_scan'], shell=True)
30subprocess.check_call(['git commit .travis.yml -m"Automatic coverity scan for {}"'.format(datetime.date.today())], shell=True)
31subprocess.check_call(['git push coverity coverity_scan -f'], shell=True)