Add a little more information to travis artifacts.
MODIFY
.travis.yml
.travis.yml
@@ -65,7 +65,7 @@ script:
after_failure:
# Upload test results. First make them smaller with optipng.
- - pip install --user --upgrade girder-client requests[security] pyOpenSSL
+ - pip install --user --upgrade girder-client requests[security] pyOpenSSL six
- find _build/images -name '*-test.png' -exec optipng {} \+ || true
- find _build/images -name '*-test.png' -exec python scripts/upload_travis_results.py {} \+ || true
# Upload build artifacts
@@ -74,7 +74,7 @@ after_failure:
after_success:
- npm run codecov
# Upload build artifacts
- - pip install --user --upgrade girder-client requests[security] pyOpenSSL
+ - pip install --user --upgrade girder-client requests[security] pyOpenSSL six
- find dist/built -type f -exec python scripts/upload_travis_results.py {} \+
deploy:

MODIFY
scripts/upload_travis_results.py
scripts/upload_travis_results.py
from __future__ import print_function
import girder_client
import os
+import six
import sys
@@ -26,7 +27,18 @@ def main():
folder = gc.loadOrCreateFolder('Travis GeoJS', folder['_id'], 'folder')
travis_build_number = os.environ.get('TRAVIS_BUILD_NUMBER')
- folder = gc.loadOrCreateFolder(travis_build_number, folder['_id'], 'folder')
+ folderName = travis_build_number
+ if os.environ.get('TRAVIS_EVENT_TYPE') == 'pull_request':
+ folderName += ' PR #%s %s' % (
+ os.environ.get('TRAVIS_PULL_REQUEST'), os.environ.get('TRAVIS_PULL_REQUEST_BRANCH'))
+ elif os.environ.get('TRAVIS_BRANCH'):
+ folderName += ' ' + os.environ.get('TRAVIS_BRANCH')
+ # folder = gc.loadOrCreateFolder(folderName, folder['_id'], 'folder')
+ try:
+ folder = six.next(gc.listFolder(folder['_id'], 'folder', name=folderName))
+ except StopIteration:
+ folder = gc.createFolder(
+ folder['_id'], folderName, os.environ.get('TRAVIS_COMMIT_MESSAGE', ''))
# If we have a build matrix, this could be of use
# travis_job_number = os.environ.get('TRAVIS_JOB_NUMBER')

Add a little more information to travis artifacts.