dpl 1.8.12.travis.1279.4 → 1.8.12.travis.1282.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzAyMWMxMmVjZTY0YWVhYTVmYjJkNTk2Y2VkYjIyYTI1NTc5MDYzYQ==
4
+ ZTdlZTI5OWZmODY4NWJhY2Y0NDdhZjYwNWZiMmY4MTlkNzA3OGEzNg==
5
5
  data.tar.gz: !binary |-
6
- YTk1MTNlYTBjZWU5ZWQwY2Q0ZGJmNzExNjYzODY5YmM0NDNiYzNlYg==
6
+ M2Y4MjNiNDZiMTEzNzhkYzUwMGEwNTY5M2ZkMzg0YTk2MWZiODUwMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OGY0ZjcxMTZkZDFhYTY1MzJiOWNhOTAwOGZlZWMwYzIzNDViY2VmODk3Yzhm
10
- NmUzNDk1MzMzZmI1YTYwMmNhMGY3NGIyOTJhZWYyNjgxNjc1NGVmZTBhZmJi
11
- NGI2ZTU4ZmM5M2FkZjMyNjcyNTBkMDY1ZmIxZDE5YjM0MWJkM2M=
9
+ YjU3M2VjNzdiMjY4N2UyNWRkMjI1ZTliNTNjZjE3MzgyMWQ5NzAyZmYzNzU1
10
+ OTU5NGJmMmZhY2QwMzBhMzdjZWY3ZTYwOWMyMWVhZmFjZjZhMGZmMWIyMTZh
11
+ OTYxN2RmYTY0MmRjN2EzYWFmYzg2Mzk5YTNlZDkwNjcwMGI1YTM=
12
12
  data.tar.gz: !binary |-
13
- NzY0MjJiOWMwN2UyM2I2ZjJiM2NjZmQ0ZTgxOTNlM2U4NDVlMjI1MWRmM2Ez
14
- YWNiZTVhNTZlNjdkYzVhNjVmNjk5MDU3NTY0MTA3Y2QyMTllMWI4NzYxOGM2
15
- YzNhYWY3ZGViMTdkNzcxNDljNDdiNzJjOGNkYzhkMzM4ZjhiNzc=
13
+ ZWZmYmFhM2UyMzYxZTlmODg3OGE2OTcxZGM5MTQzZTc0MzZkMWUyNDQwNzNm
14
+ YTRjZGExNDkzMzRiMmViMGU0ZGJkZjkzZDcwZmQxYTNjMTc0NGM3NjA5NWM2
15
+ MjIwYTI5N2FjNDYyZGE0YmFmOTRhZmY1Mzk1MTIzNTYzNjE4Yjk=
data/README.md CHANGED
@@ -600,6 +600,7 @@ For accounts using two factor authentication, you have to use an oauth token as
600
600
  * **zip_file**: The zip file that you want to deploy. _**Note:**_ you also need to use the `skip_cleanup` or the zip file you are trying to upload will be removed during cleanup.
601
601
  * **bucket_name**: Bucket name to upload app to.
602
602
  * **bucket_path**: Location within Bucket to upload app to.
603
+ * **only_create_app_version**: only create the app version, don't actually deploy it.
603
604
 
604
605
  #### Environment variables:
605
606
 
@@ -27,6 +27,10 @@ module DPL
27
27
  def check_app
28
28
  end
29
29
 
30
+ def only_create_app_version
31
+ options[:only_create_app_version]
32
+ end
33
+
30
34
  def push_app
31
35
  create_bucket unless bucket_exists?
32
36
 
@@ -39,7 +43,9 @@ module DPL
39
43
  s3_object = upload(archive_name, zip_file)
40
44
  sleep 5 #s3 eventual consistency
41
45
  version = create_app_version(s3_object)
42
- update_app(version)
46
+ if !only_create_app_version
47
+ update_app(version)
48
+ end
43
49
  end
44
50
 
45
51
  private
@@ -16,6 +16,7 @@ describe DPL::Provider::ElasticBeanstalk do
16
16
  let(:env) { 'live' }
17
17
  let(:bucket_name) { "travis-elasticbeanstalk-test-builds-#{region}" }
18
18
  let(:bucket_path) { "some/app"}
19
+ let(:only_create_app_version) { nil }
19
20
 
20
21
  let(:bucket_mock) do
21
22
  dbl = double("bucket mock", write: nil)
@@ -31,7 +32,8 @@ describe DPL::Provider::ElasticBeanstalk do
31
32
  subject :provider do
32
33
  described_class.new(
33
34
  DummyContext.new, :access_key_id => access_key_id, :secret_access_key => secret_access_key,
34
- :region => region, :app => app, :env => env, :bucket_name => bucket_name, :bucket_path => bucket_path
35
+ :region => region, :app => app, :env => env, :bucket_name => bucket_name, :bucket_path => bucket_path,
36
+ :only_create_app_version => only_create_app_version
35
37
  )
36
38
  end
37
39
 
@@ -82,6 +84,24 @@ describe DPL::Provider::ElasticBeanstalk do
82
84
 
83
85
  provider.push_app
84
86
  end
87
+
88
+ context 'only creates app version' do
89
+ let(:only_create_app_version) { true }
90
+
91
+ example 'verify the app is not updated' do
92
+
93
+ expect(provider).to receive(:s3).and_return(s3_mock).twice
94
+ expect(provider).to receive(:create_bucket)
95
+ expect(provider).to receive(:create_zip).and_return('/path/to/file.zip')
96
+ expect(provider).to receive(:archive_name).and_return('file.zip')
97
+ expect(provider).to receive(:upload).with('file.zip', '/path/to/file.zip').and_call_original
98
+ expect(provider).to receive(:sleep).with(5)
99
+ expect(provider).to receive(:create_app_version).with(bucket_mock).and_return(app_version)
100
+ expect(provider).not_to receive(:update_app).with(app_version)
101
+
102
+ provider.push_app
103
+ end
104
+ end
85
105
 
86
106
  context 'When the bucket_path option is not set' do
87
107
  example 'Does not prepend bucket_path to the s3 bucket' do
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.8.12.travis.1279.4
4
+ version: 1.8.12.travis.1282.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-22 00:00:00.000000000 Z
11
+ date: 2016-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec