Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push build artifacts from travis to data.kitware.com. #1019

Merged
merged 1 commit into from
Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
19 changes: 10 additions & 9 deletions scripts/upload_test_images.py → scripts/upload_travis_results.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import girder_client
import os
import sys
Expand All @@ -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')
Expand All @@ -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')

Expand All @@ -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__':
Expand Down