swarm_cluster_cli_ope 0.2.1 → 0.2.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7a0c1998bd04fc1f315b316b47d094352f24d07ca19cd0da18254a59bd4cd68
|
4
|
+
data.tar.gz: ef6f7962bf661d9839ace5820485896db7c4066194632d865c54e5b667c05957
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 514cca4b32bf7fa10adc40a0579a5db538a0601733ea78a0bb9514ff6b6cf006cf7bd2d6d744b508048d9a351fd79c2a5fd290b18a28c7b2fc376d19f9eed47c
|
7
|
+
data.tar.gz: f174ac4bff4447acb66218ca7d20319caf47b8cd7e67d6a52a0974cfa940eaa5888f6a649e2ccf4b4b7283840c75c1b3ebcd03d17ebe4ef0b082119087782668
|
data/Gemfile.lock
CHANGED
@@ -243,7 +243,7 @@ module SwarmClusterCliOpe
|
|
243
243
|
end
|
244
244
|
end
|
245
245
|
|
246
|
-
desc "stacksync DIRECTION", "Si occupa di scaricare|caricare,utilizzando le configurazioni presenti, i dati dallo stack remoto"
|
246
|
+
desc "stacksync [DIRECTION:pull|push]", "Si occupa di scaricare|caricare,utilizzando le configurazioni presenti, i dati dallo stack remoto"
|
247
247
|
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
248
248
|
le configurazioni sono contenute nell'array: sync_configs.
|
249
249
|
ogni configurazione è composta da:
|
@@ -256,9 +256,42 @@ module SwarmClusterCliOpe
|
|
256
256
|
- how è il come sincronizzare, definendo la tipologia:
|
257
257
|
---- pg -> DB TODO
|
258
258
|
---- mysql -> DB TODO
|
259
|
-
---- sqlite3 -> DB
|
259
|
+
---- sqlite3 -> DB: viene eseguita una copia del file
|
260
260
|
---- rsync -> RSYNC
|
261
261
|
- configs: è un hash con le configurazioni per ogni tipo di sincronizzazione
|
262
|
+
|
263
|
+
Possibili CFGS per tipologia:
|
264
|
+
rsync:
|
265
|
+
--local: -> path cartella locale
|
266
|
+
--remote: -> path cartella remota (contesto del container)
|
267
|
+
|
268
|
+
sqlite3:
|
269
|
+
--local: -> path al file
|
270
|
+
--remote: -> path al file remoto (contesto del container)
|
271
|
+
|
272
|
+
EXAMPLE:
|
273
|
+
Esempio di sincronizzazione di un file sqlite3 e una cartella
|
274
|
+
{
|
275
|
+
"stack_name": "test1",
|
276
|
+
"sync_configs": [
|
277
|
+
{
|
278
|
+
"service": "second",
|
279
|
+
"how": "rsync",
|
280
|
+
"configs": {
|
281
|
+
"remote": "/test_bind",
|
282
|
+
"local": "./uploads"
|
283
|
+
}
|
284
|
+
},
|
285
|
+
{
|
286
|
+
"service": "test_sqlite3",
|
287
|
+
"how": "sqlite3",
|
288
|
+
"configs": {
|
289
|
+
"remote": "/cartella_sqlite3/esempio.sqlite3",
|
290
|
+
"local": "./development.sqlite3"
|
291
|
+
}
|
292
|
+
}
|
293
|
+
]
|
294
|
+
}
|
262
295
|
LONGDESC
|
263
296
|
|
264
297
|
def stacksync(direction)
|
@@ -272,7 +305,10 @@ module SwarmClusterCliOpe
|
|
272
305
|
end
|
273
306
|
cfgs.env(options[:environment]) do |cfgs|
|
274
307
|
cfgs.sync_configurations.each do |sync|
|
308
|
+
say "----------->>>>>>"
|
309
|
+
say "[ #{sync.class.name} ]"
|
275
310
|
sync.send(direction)
|
311
|
+
say "<<<<<<-----------"
|
276
312
|
end
|
277
313
|
end
|
278
314
|
end
|
@@ -230,7 +230,6 @@ module SwarmClusterCliOpe
|
|
230
230
|
project_cfgs.merge!(JSON.parse(File.read(enviroment_file)).deep_symbolize_keys)
|
231
231
|
end
|
232
232
|
|
233
|
-
logger.debug { "CONFIGS[#{@environment}]: #{project_cfgs.inspect}" }
|
234
233
|
hash[key] = self.class.read_base.merge(project_cfgs)
|
235
234
|
end
|
236
235
|
|
@@ -14,12 +14,12 @@ module SwarmClusterCliOpe
|
|
14
14
|
|
15
15
|
# @return [TrueClass, FalseClass]
|
16
16
|
def push
|
17
|
-
container.copy_in(local_folder,remote_folder)
|
17
|
+
say "#{local_folder} -->> #{remote_folder}" if container.copy_in(local_folder,remote_folder)
|
18
18
|
end
|
19
19
|
|
20
20
|
# @return [TrueClass, FalseClass]
|
21
21
|
def pull
|
22
|
-
container.copy_out(remote_folder,local_folder)
|
22
|
+
say "#{remote_folder} -->> #{local_folder}" if container.copy_out(remote_folder,local_folder)
|
23
23
|
end
|
24
24
|
|
25
25
|
|