cloudfoundry/bosh-gcscli

Name: bosh-gcscli

Owner: Cloud Foundry

Description: GCS for BOSH

Created: 2017-05-23 22:41:55.0

Updated: 2017-05-27 00:41:49.0

Pushed: 2018-05-09 23:09:46.0

Homepage: null

Size: 6946

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

bosh-gcscli

GoDoc

A Golang CLI for uploading, fetching and deleting content to/from Google Cloud Storage. This tool exists to work with the bosh-cli and director.

This is not an official Google Product.

Installation
et github.com/cloudfoundry/bosh-gcscli
Commands
Usage
-gcscli --help
Upload an object
-gcscli -c config.json put <path/to/file> <remote-blob>
Fetch an object
-gcscli -c config.json get <remote-blob> <path/to/file>
Delete an object
-gcscli -c config.json delete <remote-blob>
Check if an object exists
-gcscli -c config.json exists <remote-blob>```
Configuration

The command line tool expects a JSON configuration file. Run bosh-gcscli --help for details.

Authentication Methods (credentials_source)
Running Integration Tests
  1. Ensure gcloud is installed and you have authenticated (gcloud auth login). These credentials will be used by the Makefile to create/destroy Google Cloud Storage buckets for testing.
  2. Set the Google Cloud project: gcloud config set project <your project>
  3. Generate a service account with the Storage Admin role for your project and set the contents as the environment variable GOOGLE_APPLICATION_CREDENTIALS, for example:
    rt project_id=$(gcloud config get-value project)
    
    rt service_account_name=bosh-gcscli-integration-tests
    rt service_account_email=${service_account_name}@${project_id}.iam.gserviceaccount.com
    entials_file=$(mktemp)
    
    ud config set project ${project_id}
    ud iam service-accounts create ${service_account_name} --display-name "Integration Test Access for bosh-gcscli"
    ud iam service-accounts keys create ${credentials_file} --iam-account ${service_account_email}
    ud project add-iam-policy-binding ${project_id} --member serviceAccount:${service_account_email} --role roles/storage.admin
    
    rt GOOGLE_APPLICATION_CREDENTIALS="$(cat ${credentials_file})"
    
  4. Run the unit and fast integration tests: make test-fast-int
  5. Clean up buckets: make clean-gcs
Development
Contributing

For details on how to contribute to this project - including filing bug reports and contributing code changes - please see CONTRIBUTING.md.

License

This tool is licensed under Apache 2.0. Full license text is available in LICENSE.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.