Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

gcs (1) Versions 0.8.0

LWRPs for managing GCS resources

Policyfile
Berkshelf
Knife
cookbook 'gcs', '~> 0.8.0', :supermarket
cookbook 'gcs', '~> 0.8.0'
knife supermarket install gcs
knife supermarket download gcs
README
Dependencies
Quality 33%

Google Cloud Storage Cookbook LWRP

Description

This cookbook provides libraries, resources and providers to configure
and manage Google Cloud Storage
components. The currently supported
GCS resources are:

  • bucket (bucket)
  • object (object)

Requirements

Requires fog ruby gem to interact with GCS.

Authorizing Setup

In order to use the Google Cloud Storage cookbook, you will first need to have
a Google Cloud project. Once your
project has been created, log in to the Google Developers Console and select your project. From
the Google Developers Console, on the left side of the page, click "APIs
& auth" then the "Credentials" sub menu. At the bottom of the page,
click "Return to original console". This will redirect you to the "Google APIs
Console". From the new menu on the left side of the page, click on "Google
Cloud Storage" Unless you've already enabled "Interoperable Access" you'll see
a button towards the bottom of the page. Click that button to enable
"Interoperable Access". Finally, click the new "Interoperable Access" sub menu
on the left side of the page. Your "Interoperable Storage Access Keys" will
now be listed.

    % knife data bag show gcs credentials 
    {
      "access_key_id": "AABBCCDDEE",
      "secret_access_key": "abcdefg23456789+0"
    }

This can be loaded in a recipe with:

    gcs = data_bag_item("gcs", "credentials")

And to access the values:

    gcs['access_key_id']
    gcs['secret_access_key']

Resources and Providers

This cookbook provides a resource and corresponding provider.

object.rb

Manage GCS objects with this resource.

Actions:

  • get - download an object.
  • put - upload an object.
  • delete - delete object.
  • copy - copy an object from one bucket to another.

bucket.rb

Manage GCS buckets with this resource.

Actions:

  • put - create a bucket.
  • delete - delete a bucket.

Usage

object create

This will copy a local file to GCS with default private permissions set.

    gcs_object "my_file" do
      access_key_id gcs['access_key_id']
      secret_access_key gcs['secret_access_key']
      bucket_name "my_bucket"
      local_path "/path/to/my_file"
      action :put
    end

object copy

This will copy an object from one bucket to another. By default,
the target object name will be the same as source unless specified
with the optional target_bucket_name.

    gcs_object "my_file" do
      access_key_id gcs['access_key_id']
      secret_access_key gcs['secret_access_key']
      source_bucket_name "my_bucket"
      target_bucket_name "my_other_bucket"
      action :copy
    end

License and Authors

Copyright 2014, Google, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric
            

0.8.0 passed this metric

Contributing File Metric
            

0.8.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

0.8.0 failed this metric

FC064: Ensure issues_url is set in metadata: gcs/metadata.rb:1
FC065: Ensure source_url is set in metadata: gcs/metadata.rb:1
FC066: Ensure chef_version is set in metadata: gcs/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: gcs/metadata.rb:1
FC069: Ensure standardized license defined in metadata: gcs/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: gcs/resources/bucket.rb:1
FC074: LWRP should use DSL to define resource's default action: gcs/resources/object.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

0.8.0 passed this metric

Testing File Metric
            

0.8.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

0.8.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number