do_snapshot 0.6.0 → 0.6.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 +4 -4
- data/lib/do_snapshot/cli.rb +4 -12
- data/lib/do_snapshot/version.rb +1 -1
- data/spec/do_snapshot/cli_spec.rb +1 -1
- data/spec/shared/environment.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fcb4d069e44a1e05fbb9cca875ab007b3668933
|
4
|
+
data.tar.gz: dab066517f558ea1cb6fdfb2497a4ac9f0cda002
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bbea6f804044dc1cbfe31581e6806f36a454f619cad4123bcfb89d1ece4eabd4d010fcfb9f7ca89d9544de14852a9fc255ec779f975667abc21c481c2efcdbb
|
7
|
+
data.tar.gz: 38832a5b4e1ae1863f007c496348ab6202e68b58f424d8ad1db771c001440a63e0667af0a72c9801a33643dc3ae7962eab55250d131fce60d2fd485cea718546
|
data/lib/do_snapshot/cli.rb
CHANGED
@@ -27,7 +27,7 @@ module DoSnapshot
|
|
27
27
|
set_mailer
|
28
28
|
|
29
29
|
# Check for keys via options
|
30
|
-
%w(
|
30
|
+
%w( digital_ocean_access_token ).each do |key|
|
31
31
|
ENV[key.upcase] = options[key] if options.include? key
|
32
32
|
end
|
33
33
|
end
|
@@ -40,9 +40,9 @@ module DoSnapshot
|
|
40
40
|
|
41
41
|
### Examples
|
42
42
|
|
43
|
-
Select api version (
|
43
|
+
Select api version (2):
|
44
44
|
|
45
|
-
$ do_snapshot -p
|
45
|
+
$ do_snapshot -p 2
|
46
46
|
|
47
47
|
Set DigitalOcean keys:
|
48
48
|
|
@@ -151,14 +151,6 @@ module DoSnapshot
|
|
151
151
|
type: :string,
|
152
152
|
banner: 'YOURLONGAPITOKEN',
|
153
153
|
desc: 'DIGITAL_OCEAN_ACCESS_TOKEN. if you can\'t use environment.'
|
154
|
-
method_option :digital_ocean_client_id,
|
155
|
-
type: :string,
|
156
|
-
banner: 'YOURLONGAPICLIENTID',
|
157
|
-
desc: 'DIGITAL_OCEAN_CLIENT_ID. if you can\'t use environment.'
|
158
|
-
method_option :digital_ocean_api_key,
|
159
|
-
type: :string,
|
160
|
-
banner: 'YOURLONGAPIKEY',
|
161
|
-
desc: 'DIGITAL_OCEAN_API_KEY. if you can\'t use environment.'
|
162
154
|
|
163
155
|
def snap
|
164
156
|
command.snap
|
@@ -197,7 +189,7 @@ module DoSnapshot
|
|
197
189
|
end
|
198
190
|
|
199
191
|
def command_filter
|
200
|
-
%w( log smtp mail trace
|
192
|
+
%w( log smtp mail trace digital_ocean_access_token )
|
201
193
|
end
|
202
194
|
|
203
195
|
def setup_config # rubocop:disable Metrics/AbcSize
|
data/lib/do_snapshot/version.rb
CHANGED
data/spec/shared/environment.rb
CHANGED
@@ -16,8 +16,8 @@ RSpec.shared_context 'environment' do
|
|
16
16
|
let(:image_id) { '5019770' }
|
17
17
|
let(:image_id2) { '5019903' }
|
18
18
|
let(:cli_env_nil) { Hash['DIGITAL_OCEAN_CLIENT_ID' => nil, 'DIGITAL_OCEAN_API_KEY' => nil, 'DIGITAL_OCEAN_ACCESS_TOKEN' => nil] }
|
19
|
-
let(:cli_keys) { Thor::CoreExt::HashWithIndifferentAccess.new(
|
20
|
-
let(:cli_keys_other) { Thor::CoreExt::HashWithIndifferentAccess.new(
|
19
|
+
let(:cli_keys) { Thor::CoreExt::HashWithIndifferentAccess.new(digital_ocean_access_token: access_token) }
|
20
|
+
let(:cli_keys_other) { Thor::CoreExt::HashWithIndifferentAccess.new(digital_ocean_access_token: 'NOTTOK') }
|
21
21
|
let(:snapshot_name) { "example.com_#{DateTime.now.strftime('%Y_%m_%d')}" }
|
22
22
|
let(:default_options) { Hash[protocol: 2, only: %w( 100823 ), exclude: %w(), keep: 3, stop: false, trace: true, clean: true, delay: 0, timeout: 600] }
|
23
23
|
let(:default_options_cli) { default_options.reject { |key, _| %w( droplets threads ).include?(key.to_s) } }
|