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.
Add this line to your application's Gemfile:
gem 'tumugi-plugin-google_cloud_storage'
And then execute bundle install
This target represent file or directory of Googl Cloud Storage.
name | type | required? | default | description |
---|---|---|---|---|
bucket | string | required | bucket name of GCS | |
key | string | required | key (= object name) of GCS. |
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
tumugi-plugin-google_cloud_storage provide config section named "google_cloud_storage" which can specified Google Cloud Storage autenticaion info.
Tumugi.config do |config|
config.section("google_cloud_storage") do |section|
section.project_id = "xxx"
section.client_email = "[email protected]"
section.private_key = "zzz"
end
end
Tumugi.configure do |config|
config.section("google_cloud_storage") do |section|
section.private_key_file = "/path/to/key.json"
end
end
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.
Bug reports and pull requests are welcome on GitHub at https://github.com/tumugi/ttumugi-plugin-google_cloud_storage
The gem is available as open source under the terms of the Apache License Version 2.0.