shards 2.3.4 → 2.4.0
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/Gemfile.lock +1 -1
- data/lib/settings/workflows/base.yaml +7 -1
- data/lib/settings/workflows/create_by_api.yaml +1 -0
- data/lib/settings/workflows/fast_terminal.yaml +1 -0
- data/lib/shards/db.rb +1 -1
- data/lib/shards/stage.rb +10 -1
- data/lib/shards/version.rb +1 -1
- data/lib/shards/workflow/base.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c804f800c7a67a380ec52b9aceb45ee1d206e8285aca03f5d2f66a1a386ad42e
|
4
|
+
data.tar.gz: 9d06affc175287848d498fd26c1dd2aa58f1d19084ee7287ce4f8fce722afe0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fe4f5604cada371743b2140216878bdad6e31a4ecbf34ac60165eeb48dfacc5bb87f176bb728e29a45f084faa4eb47a76dfbae42fed01c5dcd222b2b5d466a8
|
7
|
+
data.tar.gz: 1369e2c79f51e3545533c2304fd5140676315915c1290e3ba77bcf892c3f9ed3dec83b71d587f381bbc49e6854f250972df1217c3492eeb67b31689a5608c5a1
|
data/Gemfile.lock
CHANGED
@@ -110,8 +110,14 @@ shared_steps:
|
|
110
110
|
min_size: 3
|
111
111
|
regex: ^[a-z0-9_\-]*$
|
112
112
|
|
113
|
-
|
113
|
+
validate_blank_db_shard:
|
114
114
|
correct: check_shard_presence_in_shards
|
115
|
+
message: Shard %s defined as blank_db exists.
|
116
|
+
wrong_message: Shard %s does not exist and it is defined in the stage config as blank_db.
|
117
|
+
wrong: clean_repo_and_exit
|
118
|
+
|
119
|
+
validate_stage:
|
120
|
+
correct: validate_blank_db_shard
|
115
121
|
wrong_message: Stage %s does not exist.
|
116
122
|
wrong: clean_repo_and_exit
|
117
123
|
|
data/lib/shards/db.rb
CHANGED
data/lib/shards/stage.rb
CHANGED
@@ -13,7 +13,7 @@ module Shards
|
|
13
13
|
define_method(m.to_sym) { run __method__ }
|
14
14
|
end
|
15
15
|
|
16
|
-
attr_accessor :name, :location_name, :shard
|
16
|
+
attr_accessor :name, :location_name, :shard, :chosen_blank_db
|
17
17
|
|
18
18
|
def initialize name, data, location_name
|
19
19
|
|
@@ -100,6 +100,15 @@ module Shards
|
|
100
100
|
[ h , send(remote_check) ]
|
101
101
|
end.to_h
|
102
102
|
end
|
103
|
+
|
104
|
+
def blank_db_shard_key
|
105
|
+
chosen_blank_db || get('blank_db')
|
106
|
+
end
|
107
|
+
|
108
|
+
def blank_db_shard_exist?
|
109
|
+
shard.list.keys.include? blank_db_shard_key
|
110
|
+
end
|
111
|
+
|
103
112
|
end
|
104
113
|
end
|
105
114
|
|
data/lib/shards/version.rb
CHANGED
data/lib/shards/workflow/base.rb
CHANGED
@@ -223,7 +223,6 @@ module Shards
|
|
223
223
|
end
|
224
224
|
|
225
225
|
def create_database
|
226
|
-
stage.shard.db.blank_db = blank_db
|
227
226
|
stage.shard.db.create dryrun: false
|
228
227
|
message_params= [stage.shard.db.name, stage.shard.db.server]
|
229
228
|
raise_wrong_text message_params unless stage.shard.db.exist?
|
@@ -261,10 +260,16 @@ module Shards
|
|
261
260
|
@stage=location.stages[st]
|
262
261
|
end
|
263
262
|
|
263
|
+
def validate_blank_db_shard
|
264
|
+
raise_wrong_text stage.blank_db_shard_key unless stage.blank_db_shard_exist?
|
265
|
+
output_message step['message'] % stage.blank_db_shard_key
|
266
|
+
end
|
267
|
+
|
264
268
|
def ask_blank_db
|
265
269
|
shards=stage.shard.list.keys
|
266
270
|
choose_one "Databases:", shards
|
267
271
|
@blank_db=shards[answer.to_i]
|
272
|
+
stage.chosen_blank_db=blank_db
|
268
273
|
end
|
269
274
|
|
270
275
|
def add_ask_blank_db_step
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shards
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego PL
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|