1.0.5 • Published 7 years ago
rm-gcloud-put-dir v1.0.5
rm-gcloud-put-dir
Function and command line utility for RISD Media to put directories on Google Cloud Storage buckets under risd.systems
.
As a function:
var putDir = require('rm-gcloud-put-dir');
var pusher = putDir({
projectId: String,
keyFile: String,
directory: String,
siteName: String,
directoryPrefix: String // optional
gitSuffix: Boolean // optional
});
pusher.on('end', function ( error ) {
if ( error ) console.log( error )
else console.log('Done uploading!')
});
As command line utility:
rm-gcloud-put-dir directory
--siteName
--at
--gitSuffix
--gcloud
--project_id
`directory` The path to the file to upload.
Required.
`siteName` The name of the `risd.systems` bucket to put
files into.
Required.
`at` The path relative path to prepend to all
of the uploaded files.
Required.
`gitSuffix` If this flag is passed, the bucket that is
pushed to is suffixed with the current git branch.
`gcloud` Path to JSON file with gcloud credentials.
Default is `~/.risdmedia/gcloud.json`.
Expects keys: `project_id`, `private_key`,
`private_key_id`, `client_email`.
Required.
`projectId` Name of the project on Google Cloud Platform.
Optional. Defaults to `risd-media-webhook`.
Example
./bin/cli public/fonts --siteName=edu --at=static/fonts