indocker 0.1.5 → 0.1.6

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: 969dd78ffb984ee7bbf45cca5d1c6fca115e38429975b08c07f4698a5bfd05a7
4
- data.tar.gz: dfeeaceb39626a7974c95648fca8de8391e46f24756f0112634c750ecf6ad17c
3
+ metadata.gz: 69e124a571ae32781f28cbe640d3f406914c9cbbf88ebe5178d31280844c0ea6
4
+ data.tar.gz: 78f3b3a06fd08188b48ad8fedae468a62ea6d9dc348442bf22fc9fdd1b6cf93d
5
5
  SHA512:
6
- metadata.gz: 4e8a80818b4e69361ed8f51fec6a45cfe08fe63fa53d8449dd00e00877c776984b1b8c8c886a9b619857868bc0f55ad7f1f0e613cc2f282593e08a45652b225f
7
- data.tar.gz: 6cf020eb3455d8230a8e2bf5392df10e63f6d2b9ff2f181b22a87ef747b6460d28eb5dcd7c3f2d094ca5fafc94fe9628cf86260aa2b7a64cfcf59f0dd28a17a0
6
+ metadata.gz: d169e30efdcf9ae6c97bf01a836be681c9bdc6cf9515fc61d30b4ae57ad9368a96e7619703fe0ad54cba968123de6ce6da6b96f1272cd7eab95ea73e7ed6416c
7
+ data.tar.gz: e4b61302d306cc10d85edfffd37db51b668399a6c0ebb214451693394318b389bcf106fc116ee9f2ad1cf17f301c9ba17b1b4d6031a1218351f6c5210b3bd7b0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- indocker (0.1.5)
4
+ indocker (0.1.6)
5
5
  net-ssh
6
6
 
7
7
  GEM
@@ -382,33 +382,35 @@ class Indocker::ConfigurationDeployer
382
382
  @progress.start_syncing_artifact(server, artifact)
383
383
 
384
384
  thread = Thread.new do
385
- session = Indocker::SshSession.new(
386
- host: server.host,
387
- user: server.user,
388
- port: server.port,
389
- logger: @logger
390
- )
385
+ server.synchronize do
386
+ session = Indocker::SshSession.new(
387
+ host: server.host,
388
+ user: server.user,
389
+ port: server.port,
390
+ logger: @logger
391
+ )
391
392
 
392
- @logger.info("Pulling git artifact #{artifact.name.to_s.green} for #{server.user}@#{server.host}")
393
- result = clonner.clone(session, artifact.repository)
393
+ @logger.info("Pulling git artifact #{artifact.name.to_s.green} for #{server.user}@#{server.host}")
394
+ result = clonner.clone(session, artifact.repository)
394
395
 
395
- if result.exit_code != 0
396
- @logger.error("Artifact repository :#{artifact.repository.name} was not clonned")
397
- @logger.error(result.stderr_data)
398
- exit 1
399
- end
396
+ if result.exit_code != 0
397
+ @logger.error("Artifact repository :#{artifact.repository.name} was not clonned")
398
+ @logger.error(result.stderr_data)
399
+ exit 1
400
+ end
400
401
 
401
- source_path = File.join(artifact.repository.clone_path, artifact.source_path)
402
- result = session.exec!("mkdir -p #{artifact.target_path}")
403
- result = session.exec!("cp -r #{source_path} #{artifact.target_path}")
402
+ source_path = File.join(artifact.repository.clone_path, artifact.source_path)
403
+ result = session.exec!("mkdir -p #{artifact.target_path}")
404
+ result = session.exec!("cp -r #{source_path} #{artifact.target_path}")
404
405
 
405
- if !result.success?
406
- @logger.error(result.stdout_data)
407
- @logger.error(result.stderr_data)
408
- exit 1
409
- end
406
+ if !result.success?
407
+ @logger.error(result.stdout_data)
408
+ @logger.error(result.stderr_data)
409
+ exit 1
410
+ end
410
411
 
411
- @progress.finish_syncing_artifact(server, artifact)
412
+ @progress.finish_syncing_artifact(server, artifact)
413
+ end
412
414
  end
413
415
 
414
416
  RemoteOperation.new(thread, server, :artifact_sync)
@@ -17,4 +17,14 @@ class Indocker::Server
17
17
  super
18
18
  end
19
19
  end
20
+
21
+ def synchronize(&block)
22
+ semaphore.synchronize do
23
+ block.call if block_given?
24
+ end
25
+ end
26
+
27
+ def semaphore
28
+ @semaphore ||= Mutex.new
29
+ end
20
30
  end
@@ -1,3 +1,3 @@
1
1
  module Indocker
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: indocker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-06-30 00:00:00.000000000 Z
12
+ date: 2020-07-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ssh