跳转到主要内容

使用亚马逊Web服务的S3存储托管资源文件

项目描述

https://travis-ci.org/okfn/ckanext-s3filestore.svg?branch=master https://coveralls.io/repos/okfn/ckanext-s3filestore/badge.svg

ckanext-s3filestore

使用亚马逊S3作为资源存储。

需求

需要CKAN 2.5+

安装

要安装ckanext-s3filestore

  1. 激活您的CKAN虚拟环境,例如

    . /usr/lib/ckan/default/bin/activate
  2. 将ckanext-s3filestore Python包安装到您的虚拟环境中

    pip install ckanext-s3filestore
  3. s3filestore添加到CKAN配置文件中的ckan.plugins设置(默认配置文件位于/etc/ckan/default/production.ini)。

  4. 重启CKAN。例如,如果您在Ubuntu上使用Apache部署了CKAN

    sudo service apache2 reload

配置设置

必需

ckanext.s3filestore.aws_access_key_id = Your-AWS-Access-Key-ID
ckanext.s3filestore.aws_secret_access_key = Your-AWS-Secret-Access-Key
ckanext.s3filestore.aws_bucket_name = a-bucket-to-store-your-stuff

可选

# An optional path to prepend to keys
ckanext.s3filestore.aws_storage_path = my-site-name

# An optional setting to fallback to filesystem for downloads
ckanext.s3filestore.filesystem_download_fallback = true
# The ckan storage path option must also be set correctly for the fallback to work
ckan.storage_path = path/to/storage/directory

开发安装

要为开发安装ckanext-s3filestore,激活您的CKAN虚拟env并执行

git clone https://github.com/okfn/ckanext-s3filestore.git
cd ckanext-s3filestore
python setup.py develop
pip install -r dev-requirements.txt
pip install -r requirements.txt

运行测试

要运行测试,请执行

nosetests --ckan --nologcapture --with-pylons=test.ini

要运行测试并生成覆盖率报告,请首先确保您在虚拟env中安装了覆盖率工具(pip install coverage),然后运行

nosetests --ckan --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.s3filestore --cover-inclusive --cover-erase --cover-tests

在PyPI上注册ckanext-s3filestore

ckanext-s3filestore应可在PyPI上通过https://pypi.python.org/pypi/ckanext-s3filestore访问。如果该链接无法工作,您可以通过以下步骤首次在PyPI上注册项目:

  1. 创建项目的源代码分发版

    python setup.py sdist
  2. 注册项目

    python setup.py register
  3. 将源代码分发版上传到PyPI

    python setup.py sdist upload
  4. 在GitHub上使用来自setup.py文件的版本号标记项目的第一个版本。例如,如果setup.py中的版本号是0.0.1,则执行以下操作:

    git tag 0.0.1
    git push --tags

发布ckanext-s3filestore的新版本

ckanext-s3filestore可在PyPI上通过https://pypi.python.org/pypi/ckanext-s3filestore访问。要向PyPI发布新版本,请按照以下步骤操作:

  1. setup.py文件中更新版本号。有关如何选择版本号的详细信息,请参阅PEP 440

  2. 创建新版本的源代码分发版

    python setup.py sdist
  3. 将源代码分发版上传到PyPI

    python setup.py sdist upload
  4. 在GitHub上使用来自setup.py文件的版本号标记项目的最新版本。例如,如果setup.py中的版本号是0.0.2,则执行以下操作:

    git tag 0.0.2
    git push --tags

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码分发版

ckanext-s3filestore-0.0.3.tar.gz (10.8 kB 查看散列值)

上传时间 源代码

由以下支持