forked from willtrking/thumbor_aws
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request willtrking#2 from dhardy92/feature_VowsTests
[CI] add pyvows test and circleci config
- Loading branch information
Showing
12 changed files
with
337 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.pyc | ||
build | ||
*.egg-info | ||
*.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
dependencies: | ||
override: | ||
- gem install fpm | ||
- pip install pyvows coverage tornado_pyvows thumbor boto py-dateutil moto | ||
|
||
test: | ||
override: | ||
- pyvows -c -l thumbor_aws | ||
post: | ||
- fpm -s python -t deb --iteration 1 --no-python-dependencies -d python-dateutil -d thumbor -d python-boto --python-install-lib /usr/lib/python2.7/dist-packages -x "*.pyc" ./setup.py | ||
- mv ./*.deb $CIRCLE_ARTIFACTS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
# coding: utf-8 | ||
# coding: utf-8 | ||
from thumbor.config import Config | ||
Config.define('STORAGE_BUCKET', 'thumbor-images','S3 bucket for Storage', 'S3') | ||
Config.define('RESULT_STORAGE_BUCKET', 'thumbor-result', 'S3 bucket for result Storage', 'S3') | ||
Config.define('S3_LOADER_BUCKET','thumbor-images','S3 bucket for loader', 'S3') | ||
Config.define('RESULT_STORAGE_AWS_STORAGE_ROOT_PATH','', 'S3 path prefix', 'S3') | ||
Config.define('STORAGE_EXPIRATION_SECONDS', 3600, 'S3 expiration', 'S3') | ||
Config.define('S3_STORAGE_SSE', False, 'S3 encriptipon key', 'S3') | ||
Config.define('S3_STORAGE_RRS', False, 'S3 redundency', 'S3') | ||
Config.define('S3_ALLOWED_BUCKETS', False, 'List of allowed bucket to be requeted', 'S3') | ||
|
||
Config.define('AWS_ACCESS_KEY', None, 'AWS Access key, if None use environment AWS_ACCESS_KEY_ID', 'AWS') | ||
Config.define('AWS_SECRET_KEY', None, 'AWS Secret key, if None use environment AWS_SECRET_ACCESS_KEY', 'AWS') | ||
Config.define('AWS_ROLE_BASED_CONNECTION', False, 'EC2 instance can use role that does not require AWS_ACCESS_KEY see http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-usingrole-ec2instance.html', 'AWS') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
|
||
# thumbor imaging service | ||
# https://github.com/globocom/thumbor/wiki | ||
|
||
# Licensed under the MIT license: | ||
# http://www.opensource.org/licenses/mit-license | ||
# Copyright (c) 2011 globo.com [email protected] | ||
|
||
from os.path import join, abspath, dirname | ||
|
||
from thumbor.context import ServerParameters, Context | ||
from thumbor.config import Config | ||
from thumbor.importer import Importer | ||
|
||
IMAGE_URL = 's.glbimg.com/some/image_%s.jpg' | ||
IMAGE_PATH = join(abspath(dirname(__file__)), 'image.jpg') | ||
|
||
with open(IMAGE_PATH, 'r') as img: | ||
IMAGE_BYTES = img.read() | ||
|
||
def get_server(key=None): | ||
server_params = ServerParameters(8888, 'localhost', 'thumbor.conf', None, 'info', None) | ||
server_params.security_key = key | ||
return server_params | ||
|
||
def get_context(server=None, config=None, importer=None): | ||
if not server: | ||
server = get_server() | ||
|
||
if not config: | ||
config = Config() | ||
|
||
if not importer: | ||
importer = Importer(config) | ||
|
||
ctx = Context(server=server, config=config, importer=importer) | ||
return ctx |
Oops, something went wrong.