Skip to content

Commit

Permalink
Use Aki's solution
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanLorenzo committed Oct 25, 2018
1 parent 9d9a794 commit 498f695
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
21 changes: 16 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
sudo: required # Needed to install a recent version of OpenJDK as well as Python 3.7
dist: xenial

language: java
language: python

env:
JAVA_HOME=/usr/lib/jvm/java-8-oracle

matrix:
fast_finish: true
include:
- python: 3.6
env:
TOXENV=py36
jdk: openjdk7
- python: 3.7
dist: xenial # from https://github.com/travis-ci/travis-ci/issues/9815#issuecomment-401756442
group: edge # see https://github.com/travis-ci/travis-ci/issues/10212#issuecomment-429422646
env:
TOXENV=py37
jdk: openjdk8


before_install:
# Install oracle java 8, because jarsigner in openjdk 11.0.1+13 breaks
# integration tests.
# https://github.com/mozilla-releng/signingscript/issues/80
- sudo add-apt-repository -y ppa:webupd8team/java
- sudo apt-get update
- echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
- echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
- sudo apt-get install oracle-java8-installer

install:
- travis_retry pip install tox
Expand Down
11 changes: 9 additions & 2 deletions pushapkscript/test/integration/test_integration_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
test_data_dir = os.path.join(this_dir, '..', 'data')


def _get_java_path(tool_name):
if os.environ.get('JAVA_HOME'):
return os.path.join(os.environ['JAVA_HOME'], 'bin', tool_name)
return tool_name


class KeystoreManager(object):
def __init__(self, test_data_dir, certificate_alias='nightly', keystore_password='12345678'):
self.keystore_path = os.path.join(test_data_dir, 'keystore')
Expand All @@ -23,7 +29,7 @@ def __init__(self, test_data_dir, certificate_alias='nightly', keystore_password

def add_certificate(self, certificate_path):
subprocess.run([
'keytool', '-import', '-noprompt',
_get_java_path('keytool'), '-import', '-noprompt',
'-keystore', self.keystore_path, '-storepass', self.keystore_password,
'-file', certificate_path, '-alias', self.certificate_alias
])
Expand All @@ -49,6 +55,7 @@ def _generate_json(self):
"schema_file": "{project_data_dir}/pushapk_task_schema.json",
"verbose": true,
"jarsigner_binary": "{binary}",
"jarsigner_key_store": "{keystore_path}",
"jarsigner_certificate_alias": "{certificate_alias}",
"google_play_accounts": {{
Expand All @@ -60,7 +67,7 @@ def _generate_json(self):
"taskcluster_scope_prefix": "project:releng:googleplay:"
}}'''.format(
work_dir=self.work_dir, test_data_dir=self.test_data_dir, project_data_dir=project_data_dir,
keystore_path=self.keystore_manager.keystore_path,
binary=_get_java_path('jarsigner'), keystore_path=self.keystore_manager.keystore_path,
certificate_alias=self.keystore_manager.certificate_alias
))

Expand Down

0 comments on commit 498f695

Please sign in to comment.