Skip to content

Commit

Permalink
Merge pull request #1019 from OpenGeoscience/push-artifacts
Browse files Browse the repository at this point in the history
Push build artifacts from travis to data.kitware.com.
  • Loading branch information
manthey authored Aug 29, 2019
2 parents 3820af9 + a47bc31 commit 682c421
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
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

0 comments on commit 682c421

Please sign in to comment.