swarm_cluster_cli_ope 0.2 → 0.2.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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 473cc11423d57b9b40b361184587b1acdda0d14751b12266740eb98e1f1c7caa
4
- data.tar.gz: 542e14fb88a4d40c34209853678e80fc0d2bddc90745aa9bd6eaee666e7fcf03
3
+ metadata.gz: de6a7a1c00385430cb66e44f3fc8c02bac60bc5c930223c9cf56d592205d4963
4
+ data.tar.gz: 6e400a291bc159ac2e6149f55fe46cbe7dcdeb84b391ee4d7f93c211d19625d2
5
5
  SHA512:
6
- metadata.gz: 90fe0e391b0aa2eb12f1564153905db9fd294aa2817094da62dc1a7da7c3c663f7f94f99996d5f3c1e7818f1d8d214d2c1286fdefbe9eedfb932c3abdf224586
7
- data.tar.gz: 24e26ab924509fbc0df1d03a67c59ec5d62d544a8cc0709f757012c2dcb6fd8915a049ad82ccec49316f19b4cdb65c1bac9f4c62e3a1c4231f5de7c316bbcbc1
6
+ metadata.gz: e680840f5518ac667362afde85caca8f10a86bbb77cc122bd53580284e7ee8c6f365bc0b5b0f158eb494a97431765fd9cf057554c6ed20d3e10ef91779cd1dc3
7
+ data.tar.gz: 3976388f15a0fe1fd34efe15f2977f3b21d5167c7bbbf3d534c5ab0c10e1b34126110f36e00f186c3cd66b8456929db58585e29a414d6799f1a66b69352e7b31
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- swarm_cluster_cli_ope (0.2)
4
+ swarm_cluster_cli_ope (0.2.1)
5
5
  activesupport
6
6
  open4
7
7
  thor (~> 1.0)
@@ -181,7 +181,7 @@ module SwarmClusterCliOpe
181
181
  }
182
182
  })
183
183
 
184
- puts "COMPLETATO" if cmd.send(execute)
184
+ puts "COMPLETATO" if cmd.send(execute)
185
185
 
186
186
  end
187
187
  end
@@ -243,28 +243,36 @@ module SwarmClusterCliOpe
243
243
  end
244
244
  end
245
245
 
246
- desc "stack_pull", "Si occupa di scaricare,utilizzando le configurazioni presenti, i dati dallo stack remoto"
247
- long_desc <<-LONGDESC
248
- le configurazioni sono contenute nell'array: sync_configs. \n
249
- ogni configurazione è composta da: \n
250
- { \n
251
- service:"" \n
252
- how:"" \n
253
- configs:{ }\n
254
- }\n
255
- - service è il nome del servizio\n
256
- - how è il come sincronizzare, definendo la tipologia:\n
257
- - pg -> DB\n TODO
258
- - mysql -> DB\n TODO
259
- - sqlite3 -> DB\n
260
- - rsync -> RSYNC\n
261
- - configs: è un hash con le configurazioni per ogni tipo di sincronizzazione\n
246
+ desc "stacksync DIRECTION", "Si occupa di scaricare|caricare,utilizzando le configurazioni presenti, i dati dallo stack remoto"
247
+ long_desc <<-LONGDESC.gsub("\n", "\x5")
248
+ le configurazioni sono contenute nell'array: sync_configs.
249
+ ogni configurazione è composta da:
250
+ {
251
+ service:""
252
+ how:""
253
+ configs:{ }
254
+ }
255
+ - service è il nome del servizio
256
+ - how è il come sincronizzare, definendo la tipologia:
257
+ ---- pg -> DB TODO
258
+ ---- mysql -> DB TODO
259
+ ---- sqlite3 -> DB
260
+ ---- rsync -> RSYNC
261
+ - configs: è un hash con le configurazioni per ogni tipo di sincronizzazione
262
262
  LONGDESC
263
263
 
264
- def stack_pull
264
+ def stacksync(direction)
265
+ direction = case direction
266
+ when 'push'
267
+ :push
268
+ when 'pull'
269
+ :pull
270
+ else
271
+ raise "ONLY [push|pull] action accepted"
272
+ end
265
273
  cfgs.env(options[:environment]) do |cfgs|
266
274
  cfgs.sync_configurations.each do |sync|
267
- sync.pull
275
+ sync.send(direction)
268
276
  end
269
277
  end
270
278
  end
@@ -1,3 +1,3 @@
1
1
  module SwarmClusterCliOpe
2
- VERSION = "0.2"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swarm_cluster_cli_ope
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marino Bonetti