From b3e38468b088eaa737abd83ca364e9a32e1c45e1 Mon Sep 17 00:00:00 2001 From: Ilya Radchenko Date: Thu, 8 Oct 2020 11:37:29 -0400 Subject: [PATCH] fix: actually pass down makePublic option --- README.md | 11 ++++++----- index.js | 10 ++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0280f45..21e776e 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,13 @@ ember install ember-cli-deploy-gcloud-storage - Place the following configuration into `config/deploy.js` ```javascript -ENV["gcloud-storage"] = { +ENV['gcloud-storage'] = { credentials: { - private_key: "", - client_email: "", + private_key: '', + client_email: '', }, - projectId: "", - bucket: "", + projectId: '', + bucket: '', }; ``` @@ -47,6 +47,7 @@ ember deploy production ## Configuration - `credentials` - GCP credentials object, `{ private_key, client_email }`, required (can be specified with GCP envs/config). +- `keyFilename` - Alternative configuration to the `credentials` option. Specify the path to the key file downloaded for service account. - `projectId` - Your GCP project id, required (can be specified with GCP envs, `GCLOUD_PROJECT= ember deploy`). - `bucket` - A bucket in GCS to store your files, required. - `bucketFolder` - A folder inside the bucket to place your files, optional. diff --git a/index.js b/index.js index 8160bb7..3aff3c1 100644 --- a/index.js +++ b/index.js @@ -36,6 +36,7 @@ module.exports = { var gzippedFiles = this.readConfig('gzippedFiles'); var filePattern = this.readConfig('filePattern'); var metadata = this.readConfig('metadata'); + var makePublic = this.readConfig('makePublic'); var filesToUpload = distFiles.filter( minimatch.filter(filePattern, { matchBase: true }) ); @@ -43,12 +44,13 @@ module.exports = { this.log('uploading..'); var config = { - bucket: bucket, - bucketFolder: bucketFolder, + bucket, + bucketFolder, fileBase: context.distDir, filePaths: filesToUpload, gzippedFilePaths: gzippedFiles, - metadata: metadata, + metadata, + makePublic, gcloud: {}, }; @@ -67,7 +69,7 @@ module.exports = { self.log('uploaded ' + filesUploaded.length + ' files ok', { verbose: true, }); - return { filesUploaded: filesUploaded }; + return { filesUploaded }; }) .catch(this._errorMessage.bind(this)); },