From a47bc31f879919d278f6bd5ce1af5ce215e3ab71 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Wed, 28 Aug 2019 15:29:45 -0400 Subject: [PATCH] Push build artifacts from travis to data.kitware.com. --- .travis.yml | 18 +++++++----------- CHANGELOG.md | 2 +- ...est_images.py => upload_travis_results.py} | 19 ++++++++++--------- 3 files changed, 18 insertions(+), 21 deletions(-) rename scripts/{upload_test_images.py => upload_travis_results.py} (69%) diff --git a/.travis.yml b/.travis.yml index 750436c6b0..1eeaa033f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,20 +66,16 @@ script: after_failure: # Upload test results. First make them smaller with optipng. - pip install --user --upgrade girder-client requests[security] - - find _build/images -name '*-test.png' -exec optipng {} \+ - - find _build/images -name '*-test.png' -exec python scripts/upload_test_images.py {} \+ + - 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 + - find dist/built -type f -exec python scripts/upload_travis_results.py {} \+ || true after_success: - npm run codecov - # This was used to send build notes to an S3 bucket - # - pip install --user GitPython boto3 - # - python $TRAVIS_BUILD_DIR/scripts/upload_notes.py --repo $TRAVIS_BUILD_DIR --upload $TRAVIS_BUILD_DIR/_build/build_notes.json - -# Use this for AWS credentials -# env: -# global: -# - secure: JYWs3zJV09uAb7CvX32pADRYTH2XqSGvImNEI6zVFxJxs9r0JsGgyOTz4PPBgs3dv1OjVBXqxu4GD2ZBKeo0Ax13ZnBNVR/BacupBtIwXbxp/FG2lr+WBzE0YnEBhAF/mW5DEkNBWJyLSiBlxYA5QFAAHYwb/GOADl+Z9Qi2FIU= -# - secure: on13Ka+3jkLDCXxqzxuT+CY4sPM0Zxfbe9M2F3LE0yhN2ww5vaBKdbTrzEWa0TOlBkM2qQUPAFybjHXfHeRyKpZDlsssjogH8YO5qx4zFRP5ZB9ny39QAqBsfZTuXt2WmOTLEcXkByYXVH8my/8ZqZqofSeBZsZdeauzoLbr0R0= + # Upload build artifacts + - pip install --user --upgrade girder-client requests[security] + - find dist/built -type f -exec python scripts/upload_travis_results.py {} \+ deploy: - provider: pages diff --git a/CHANGELOG.md b/CHANGELOG.md index dabc3ad758..89fb579837 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## Version 0.19.6 ### Features -- Added a polygonSearch method to features +- Added a polygonSearch method to features (#1014) ### Changes - The feature boxSearch function now uses map input gcs coordinates consistently and returns results in the same format as pointSearch (#1014) diff --git a/scripts/upload_test_images.py b/scripts/upload_travis_results.py similarity index 69% rename from scripts/upload_test_images.py rename to scripts/upload_travis_results.py index 0207b9ae93..86916e87c8 100755 --- a/scripts/upload_test_images.py +++ b/scripts/upload_travis_results.py @@ -1,3 +1,4 @@ +from __future__ import print_function import girder_client import os import sys @@ -7,7 +8,7 @@ def main(): # Use the API key to authenticate. key = os.environ.get('GIRDER_API_KEY') if key is None: - print >>sys.stderr, 'Environment variable GIRDER_API_KEY is blank. Cannot upload images.' + print('Environment variable GIRDER_API_KEY is blank. Cannot upload files.', file=sys.stderr) return 1 gc = girder_client.GirderClient(host='data.kitware.com', scheme='https') @@ -18,9 +19,9 @@ def main(): # Retrieve the target folder, which should be at ~/Public/Travis\ GeoJS user = gc.get('user/me') if user is None: - print >>sys.stderr, 'No user logged in; API key may be bad.' + print('No user logged in; API key may be bad.', file=sys.stderr) return 1 - folder = gc.loadOrCreateFolder('Public', user['_id'], 'user') + folder = gc.get('resource/lookup', parameters={'path': 'collection/GeoJS/Public'}) folder = gc.loadOrCreateFolder('Travis GeoJS', folder['_id'], 'folder') @@ -32,15 +33,15 @@ def main(): # folder = gc.loadOrCreateFolder(travis_job_number, folder['_id'], 'folder') # Upload the files specified on the command line, creating an item for each - for imageFile in sys.argv[1:]: - (dirname, filename) = os.path.split(imageFile) - size = os.stat(imageFile).st_size - print dirname, filename - with open(imageFile, 'rb') as fd: + for fileName in sys.argv[1:]: + (dirname, filename) = os.path.split(fileName) + size = os.stat(fileName).st_size + print(dirname, filename) + with open(fileName, 'rb') as fd: gc.uploadFile( parentId=folder['_id'], stream=fd, name=filename, size=size, parentType='folder') - print 'uploaded' + print('uploaded') if __name__ == '__main__':