-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoveralls.py
31 lines (26 loc) · 1.04 KB
/
coveralls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
import unittest
from os.path import expanduser
from util.Docker import Docker
class JavaServices(unittest.TestCase):
def test_maven(self):
script_dir = os.path.dirname(os.path.realpath(__file__))
code_dir = script_dir + "/.."
home = expanduser("~")
command = ['docker', 'run', '--rm',
'-v', home + '/.m2:/root/.m2',
'-v', code_dir + ':/usr/src/mymaven',
'-w', '/usr/src/mymaven',
'maven:3.2-jdk-8',
'mvn',
'-DrepoToken=' + os.getenv('COVERALLS_TOKEN'),
'-DserviceJobId=' + os.getenv('TRAVIS_JOB_ID'),
'-Dbranch=' + os.getenv('TRAVIS_BRANCH'),
'-DpullRequest=' + os.getenv('TRAVIS_PULL_REQUEST'),
'-DserviceName=' + os.getenv('TRAVIS'),
'verify',
'jacoco:report',
'coveralls:report']
print(Docker().execute(command))
if __name__ == '__main__':
unittest.main()