diff options
author | Dan Albert <danalbert@google.com> | 2015-01-09 16:18:48 -0800 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2015-01-09 16:18:48 -0800 |
commit | 691e809edbe354f0432a0d3d33716dd65d68b155 (patch) | |
tree | bec225c573f38133d1bcac74dfd114b835c67f9c /tools | |
parent | 84cbe0491857471d3e4208f0d9cc184adb43914b (diff) | |
download | bionic-691e809edbe354f0432a0d3d33716dd65d68b155.zip bionic-691e809edbe354f0432a0d3d33716dd65d68b155.tar.gz bionic-691e809edbe354f0432a0d3d33716dd65d68b155.tar.bz2 |
Make service URLs configurable.
Change-Id: I91df77b7e0294be5e6180460b0ef26d7ead2ea7d
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bionicbb/README.md | 20 | ||||
-rw-r--r-- | tools/bionicbb/gmail_listener.py | 9 |
2 files changed, 16 insertions, 13 deletions
diff --git a/tools/bionicbb/README.md b/tools/bionicbb/README.md index d2dd2e0..91f64d8 100644 --- a/tools/bionicbb/README.md +++ b/tools/bionicbb/README.md @@ -20,11 +20,15 @@ Setup Create a `config.py` in the same directory as the sources. The structure of the configuration file is as follows: - client_secret_file = 'CLIENT_SECRET_FILE.json' - jenkins_credentials = { - 'username': 'JENKINS_USERNAME', - 'password': 'JENKINS_PASSWORD', - } +```python +client_secret_file = 'CLIENT_SECRET_FILE.json' +build_listener_url = 'BUILD_LISTENER_URL' +jenkins_url = 'JENKINS_URL' +jenkins_credentials = { + 'username': 'JENKINS_USERNAME', + 'password': 'JENKINS_PASSWORD', +} +``` The client secret file comes from the Gmail API page of the [Google Developers Console](https://console.developers.google.com/). The Jenkins credentials are @@ -37,8 +41,10 @@ settings](https://android-review.googlesource.com/#/settings/http-password). To launch the services: - $ python build_listener.py >build.log 2>&1 & - $ python gmail_listener.py >mail.log 2>&1 & +```bash +$ python build_listener.py >build.log 2>&1 & +$ python gmail_listener.py >mail.log 2>&1 & +``` The mail listener will direct your browser to an authentication page for the Gmail API. diff --git a/tools/bionicbb/gmail_listener.py b/tools/bionicbb/gmail_listener.py index e7d0d4d..795efd8 100644 --- a/tools/bionicbb/gmail_listener.py +++ b/tools/bionicbb/gmail_listener.py @@ -94,8 +94,7 @@ def get_gerrit_info(body): def clean_project(gerrit_info, dry_run): username = bionicbb.config.jenkins_credentials['username'] password = bionicbb.config.jenkins_credentials['password'] - # TODO(danalbert): Move Jenkins server URL into config.py. - jenkins_url = 'http://bionicbb.mtv.corp.google.com:8080' + jenkins_url = bionicbb.config.jenkins_url jenkins = jenkinsapi.api.Jenkins(jenkins_url, username, password) build = 'clean-bionic-presubmit' @@ -130,7 +129,7 @@ def build_project(gerrit_info, dry_run): username = bionicbb.config.jenkins_credentials['username'] password = bionicbb.config.jenkins_credentials['password'] - jenkins_url = 'http://bionicbb.mtv.corp.google.com:8080' + jenkins_url = bionicbb.config.jenkins_url jenkins = jenkinsapi.api.Jenkins(jenkins_url, username, password) project = gerrit_info['Project'] @@ -198,9 +197,7 @@ def drop_rejection(gerrit_info, dry_run): 'changeid': gerrit_info['Change-Id'], 'patchset': gerrit_info['PatchSet'] } - # TODO(danalbert): Move the URL for the build listener service into - # config.py. - url = 'http://bionicbb.mtv.corp.google.com:5000/drop-rejection' + url = '{}/{}'.format(bionicbb.config.build_listener_url, 'drop-rejection') headers = {'Content-Type': 'application/json;charset=UTF-8'} if not dry_run: try: |