Code Monkey home page Code Monkey logo

blobby-gcs's Introduction

Blobby::GCSStore Build status

This gem provides a Google Cloud Storage (GCS) implementation of the "store" interface defined by the blobby gem. It's been packaged separately to avoid adding dependencies to the core gem.

The simplest use-case is writing to a single bucket:

gcs_store = Blobby.store("gs://<bucket_name>/<directory_path_inside_bucket>")
gcs_store["key"].write("IO or string file content")

Configuration is provided using the same environment variables as the google-cloud-storage gem (which this one is wrapping).

require 'blobby-gcs'

ENV["GOOGLE_CLOUD_PROJECT"] = "my-project-id"
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/keyfile.json"

gcs_store = Blobby.store("gs://<bucket_name>/<directory_path_inside_bucket>")

Installation

Add this line to your application's Gemfile:

gem 'blobby-gcs'

And then execute:

$ bundle

Or install it yourself as:

$ gem install blobby-gcs

Development

You can run the tests within Docker via auto/test or directly within your shell using scripts/test.

There are integration tests within this gem which point to a real Google Cloud Storage bucket, so credentials are required. If you do not already have ~/.config/gcloud/application_default_credentials.json from authenticating with gcloud, run:

$ gcloud auth application-default login

You will also need to provide the name of a GCS bucket you have storage.objectAdmin access to (and unfortunately, also storage.legacyBucketReader):

export GOOGLE_CLOUD_PROJECT=unused
export BLOBBY_GCS_TEST_BUCKET=...name of bucket...

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and publish the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/greensync/blobby-gcs.

License

The gem is available as open source under the terms of the MIT License.

blobby-gcs's People

Contributors

dependabot[bot] avatar jasonona avatar jpaulgs avatar maddymarkovitz avatar nickburgin avatar thomasvdpol avatar tvanderpol avatar zimbix avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blobby-gcs's Issues

Fixup the build for Workload Identity

So the builds are failing following greensync/platform-work#318

Likely we just need to unset the GOOGLE_APPLICATION_CREDENTIALS environment variable in the docker-compose entrypoint.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.