dpl 1.6.5.travis.463.1 → 1.6.5.travis.466.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDdjZjBiNjhjZDQ1ZjA4MjUxM2MxMDI1OWM2ZjJmNjI2ODdhYTRlYw==
4
+ ZGY4NGMzOGU1NTUxZWUxYjU0ZjZkOTkxMjZmMDM1NWJkNWEyMDEwZQ==
5
5
  data.tar.gz: !binary |-
6
- MjIxMWQ5MTY4MzIzMjAxZjI4ZWQ4YmYyNTVkMjcyNzllOTNiZmI3ZQ==
6
+ YTlkNDhkNzYxMmIzNTY0ZTI3MjI1MWVhZWQ2NmJhNzFjODhmMDRhZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTI5YmI5YjZlNmIxMTk4YWViMjk4ZGQ1ZTNkMDM3MTljNDkyNzUyZDhkMzk2
10
- NzVhOGI3MTlmNjJmZGY4ZTE0N2NlNDIxZWQwMDIxNTE1NjBkMjg2MjA0YWFh
11
- ODM4ZTQ0NTUyNGFkODkwNzU3MmFkNTNiMjAwNWVlMWEwMmJlNTA=
9
+ YzNiYmIwN2MzMjdlODJjYTA0MWU4MTFkOGJjMzYxOTA0ZTk4NGNiYTgwYWZj
10
+ Nzg4YzFiNmZjMDg0OTllNzc2ZWI2MmQyNjFlZDA5ZTYwNjAwZTRiZThhYTE0
11
+ NzNiZThhZWIxNGY0YmRjMGExMTE4YWUzNjZhMTMzYzJiMjhiMGU=
12
12
  data.tar.gz: !binary |-
13
- MGYxMzgzNjFkMDVjN2IxNDQwZDlhMGU4YzBkY2JmYjdlZDQ3YTc2MTM2Y2Ji
14
- NGIyNWI3YzU5YjIwMGNjZTkwZWE4OWIzMTlmYzk2ZDFkNWM1Y2ViMmU4YTRi
15
- YWExMTI5OTgzMzdhMDllYTBiZTViZjUyNzhkOWFjNjc3YWE0NTU=
13
+ NDk3ZjA4YjVkMGY3M2Q5MjlmYjBjZjMxNzFjNWQ4MWY1M2ZmYjQ5NjlmZDA4
14
+ OWE2ZWViNWMyYTdkMGI3ZTQwMzZhMjI2Mzc1N2Y0ZjdiMDJiZjVkZjgwMjRm
15
+ OWMwYmFkZDFhZDkzYjFhZmZhMWQ1OTVjMjY0YmUzMmQ5MjE4ZjQ=
data/Gemfile CHANGED
@@ -36,3 +36,7 @@ end
36
36
  group :ninefold do
37
37
  gem 'ninefold'
38
38
  end
39
+
40
+ group :gcs do
41
+ gem 'gstore'
42
+ end
data/README.md CHANGED
@@ -25,6 +25,7 @@ Dpl supports the following providers:
25
25
  * [Ninefold](#ninefold)
26
26
  * [Hackage](#hackage)
27
27
  * [Deis](#deis)
28
+ * [Google Cloud Storage](#google-cloud-storage)
28
29
 
29
30
  ## Installation:
30
31
 
@@ -180,10 +181,12 @@ As a rule of thumb, you should switch to the Git strategy if you run into issues
180
181
  * **endpoint**: S3 Endpoint. Defaults to s3.amazonaws.com.
181
182
  * **upload-dir**: S3 directory to upload to. Defaults to root directory.
182
183
  * **local-dir**: Local directory to upload from. Can be set from a global perspective (~/travis/build) or relative perspective (build) Defaults to project root.
184
+ * **detect-encoding**: Set HTTP header `Content-Encoding` for files compressed with `gzip` and `compress` utilities.
183
185
 
184
186
  #### Examples:
185
187
 
186
188
  dpl --provider=s3 --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --bucket=<bucket>
189
+ dpl --provider=s3 --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --bucket=<bucket> --detect-encoding
187
190
  dpl --provider=s3 --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --bucket=<bucket> --region:us-west-2 --local-dir= BUILD --upload-dir=BUILDS
188
191
 
189
192
  ### OpsWorks:
@@ -327,3 +330,17 @@ For accounts using two factor authentication, you have to use an oauth token as
327
330
  #### Examples:
328
331
 
329
332
  dpl --provider=deis --controller=deis.deisapps.com --username=travis --password=secret --app=example
333
+
334
+ ### Google Cloud Storage:
335
+
336
+ #### Options:
337
+
338
+ * **access-key-id**: GCS Interoperable Access Key ID. Info about Interoperable Access Key from [here](https://developers.google.com/storage/docs/migrating).
339
+ * **secret-access-key**: GCS Interoperable Access Secret.
340
+ * **bucket**: GCS Bucket.
341
+ * **local-dir**: Local directory to upload from. Can be set from a global perspective (~/travis/build) or relative perspective (build) Defaults to project root.
342
+
343
+ #### Examples:
344
+
345
+ dpl --provider=gcs --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --bucket=<bucket>
346
+ dpl --provider=gcs --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --bucket=<bucket> --local-dir= BUILD
data/lib/dpl/provider.rb CHANGED
@@ -26,6 +26,7 @@ module DPL
26
26
  autoload :Ninefold, 'dpl/provider/ninefold'
27
27
  autoload :Hackage, 'dpl/provider/hackage'
28
28
  autoload :Deis, 'dpl/provider/deis'
29
+ autoload :GCS, 'dpl/provider/gcs'
29
30
 
30
31
  def self.new(context, options)
31
32
  return super if self < Provider
@@ -0,0 +1,42 @@
1
+ require 'kconv'
2
+
3
+ module DPL
4
+ class Provider
5
+ class GCS < Provider
6
+ requires 'gstore'
7
+ experimental 'Google Cloud Storage'
8
+
9
+ def needs_key?
10
+ false
11
+ end
12
+
13
+ def client
14
+ @client ||= GStore::Client.new(
15
+ :access_key => option(:access_key_id),
16
+ :secret_key => option(:secret_access_key)
17
+ )
18
+ end
19
+
20
+ def check_auth
21
+ log "Logging in with Access Key: #{option(:access_key_id)[-4..-1].rjust(20, '*')}"
22
+ end
23
+
24
+ def push_app
25
+ Dir.chdir(options.fetch(:local_dir, Dir.pwd)) do
26
+ Dir.glob("**/*") do |filename|
27
+ next if File.directory?(filename)
28
+
29
+ log "Push: #{filename}"
30
+
31
+ client.put_object(
32
+ option(:bucket),
33
+ filename,
34
+ :data => File.read(filename)
35
+ )
36
+ end
37
+ end
38
+ end
39
+
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,46 @@
1
+ require 'spec_helper'
2
+ require 'dpl/provider/gcs'
3
+
4
+ describe DPL::Provider::GCS do
5
+
6
+ subject :provider do
7
+ described_class.new(DummyContext.new, :access_key_id => 'qwertyuiopasdfghjklz', :secret_access_key => 'qwertyuiopasdfghjklzqwertyuiopasdfghjklz', :bucket => 'my-bucket')
8
+ end
9
+
10
+ describe "#check_auth" do
11
+ example do
12
+ expect(provider).to receive(:log).with("Logging in with Access Key: ****************jklz")
13
+ provider.check_auth
14
+ end
15
+ end
16
+
17
+ describe "#needs_key?" do
18
+ example do
19
+ expect(provider.needs_key?).to eq(false)
20
+ end
21
+ end
22
+
23
+ describe "#push_app" do
24
+ example "Without local_dir" do
25
+ expect(Dir).to receive(:chdir).with(Dir.pwd)
26
+ provider.push_app
27
+ end
28
+
29
+ example "With local_dir" do
30
+ provider.options.update(:local_dir => 'BUILD')
31
+
32
+ expect(Dir).to receive(:chdir).with('BUILD')
33
+ provider.push_app
34
+ end
35
+ end
36
+
37
+ describe '#client' do
38
+ example do
39
+ expect(GStore::Client).to receive(:new).with(
40
+ :access_key => 'qwertyuiopasdfghjklz',
41
+ :secret_key => 'qwertyuiopasdfghjklzqwertyuiopasdfghjklz'
42
+ )
43
+ provider.client
44
+ end
45
+ end
46
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.5.travis.463.1
4
+ version: 1.6.5.travis.466.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-13 00:00:00.000000000 Z
11
+ date: 2014-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -108,6 +108,7 @@ files:
108
108
  - lib/dpl/provider/divshot.rb
109
109
  - lib/dpl/provider/dot_cloud.rb
110
110
  - lib/dpl/provider/engine_yard.rb
111
+ - lib/dpl/provider/gcs.rb
111
112
  - lib/dpl/provider/hackage.rb
112
113
  - lib/dpl/provider/heroku.rb
113
114
  - lib/dpl/provider/heroku/anvil.rb
@@ -136,6 +137,7 @@ files:
136
137
  - spec/provider/deis_spec.rb
137
138
  - spec/provider/divshot_spec.rb
138
139
  - spec/provider/dotcloud_spec.rb
140
+ - spec/provider/gcs_spec.rb
139
141
  - spec/provider/hackage_spec.rb
140
142
  - spec/provider/heroku_anvil_spec.rb
141
143
  - spec/provider/heroku_git_deploy_key_spec.rb