Skip to content

tumugi/tumugi-plugin-google_cloud_storage

Repository files navigation

Build Status Code Climate Coverage Status Gem Version

Google Cloud Storage plugin for [tumugi]((https://github.com/tumugi/tumugi)

tumugi-plugin-google_cloud_storage is a plugin for integrate Google Cloud Storage and tumugi.

Installation

Add this line to your application's Gemfile:

gem 'tumugi-plugin-google_cloud_storage'

And then execute bundle install

Target

Tumugi::Plugin::GoogleCloudStorageFileTarget

This target represent file or directory of Googl Cloud Storage.

Paramters

name type required? default description
bucket string required bucket name of GCS
key string required key (= object name) of GCS.

Examples

Create a file which content is "done" in Google Cloud Storage.

task :task1 do
  param :bucket, type: :string, auto_bind: true, required: true
  param :day, type: :time, auto_bind: true, required: true

  output do
    target(:google_cloud_storage_file,
      bucket: bucket,
      key: "test_#{day.strftime('%Y%m%d')}.txt")
  end

  run do
    log 'task1#run'
    output.open('w') {|f| f.puts('done') }
  end
end

Execute this file:

$ bundle exec tumugi run -f workflow.rb -p bucket:BUCKET_NAME day:2016-07-01

Config Section

tumugi-plugin-google_cloud_storage provide config section named "google_cloud_storage" which can specified Google Cloud Storage autenticaion info.

Authenticate by client_email and private_key

Tumugi.config do |config|
  config.section("google_cloud_storage") do |section|
    section.project_id = "xxx"
    section.client_email = "yyy@yyy.iam.gserviceaccount.com"
    section.private_key = "zzz"
  end
end

Authenticate by JSON key file

Tumugi.configure do |config|
  config.section("google_cloud_storage") do |section|
    section.private_key_file = "/path/to/key.json"
  end
end

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/tumugi/ttumugi-plugin-google_cloud_storage

License

The gem is available as open source under the terms of the Apache License Version 2.0.

About

Tumugi plugin for Google Cloud Storage

Resources

Stars

Watchers

Forks

Packages

No packages published