Skip to content

Commit 367a5db

Browse files
Merge pull request #1209 from travis-ci/sc-fix-caches
Fix caches in GCS
2 parents b9dc43f + 6415ae1 commit 367a5db

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/travis/services/find_caches.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def fetch_s3(cache_objects, options)
154154
def fetch_gcs(cache_objects, options)
155155
config = cache_options[:gcs]
156156
storage = ::Google::Apis::StorageV1::StorageService.new
157-
json_key_io = StringIO.new(config.to_h[:json_key])
157+
json_key_io = StringIO.new(JSON.dump(config.to_h[:json_key]))
158158
bucket_name = config[:bucket_name]
159159

160160
storage.authorization = ::Google::Auth::ServiceAccountCredentials.make_creds(

spec/lib/services/find_caches_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
end
7272

7373
context 'with GCS configuration' do
74-
let(:cache_options) { { gcs: { bucket_name: '', json_key: '' } } }
74+
let(:cache_options) { { gcs: { bucket_name: '', json_key: { type: 'service_account', project_id: 'test-project-id' } } } }
7575
its(:size) { is_expected.to eq 0 }
7676
end
7777
end

0 commit comments

Comments
 (0)