orchestration 0.3.0 → 0.3.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
  SHA1:
3
- metadata.gz: 13a569a8391d7110efc2606ba1d486e29e342080
4
- data.tar.gz: c5eed32f638f89dce179cd93c8f634504fe628d2
3
+ metadata.gz: 377c0f68de78347f2db6d0cd5caee441f1db097b
4
+ data.tar.gz: 1e2e41b54ed59837308772e32d008b1f58842857
5
5
  SHA512:
6
- metadata.gz: 91481f33e8f48bfabe18ab3c36fab7381060c631a62da15f3806197f7ec3ef08815a93790d132cf8431606eb6d110792f86c26fe3b7783a2e347a61f6e05a0cc
7
- data.tar.gz: 32f5222a028460e9d5bb5b4477dae935a83692d7f50dae1e62d0b24b19fb3fb4db5c38453f2a1f9a787502868bb45d0a0284d9a99d331507c7cef9278ef7f7ac
6
+ metadata.gz: af1a3883b1b8ac1eb72fcf91bb080b7ce54d6585315bd96ab69cfcf3e5209d6a57e2c82c8976570a2e857501702a8388e8ca0df92a8729a9df4cf095aa57a184
7
+ data.tar.gz: 6c8d67d40c4066440ff1070b58140ad04e972d79785017bb291fece26a35ec1cf31dc7b649be067d468c52928cf6a5300ce55f2a4c467508914ab7ad0230e37a
data/README.md CHANGED
@@ -18,7 +18,7 @@ Containers are automatically created for the following dependencies:
18
18
  Add this line to your application's Gemfile:
19
19
 
20
20
  ```ruby
21
- gem 'orchestration', '~> 0.3.0'
21
+ gem 'orchestration', '~> 0.3.1'
22
22
  ```
23
23
 
24
24
  And then build your bundle:
@@ -88,13 +88,6 @@ To start services:
88
88
  $ make start
89
89
  ```
90
90
 
91
- This will launch any dependencies your project needs (e.g. _MySQL_, _MongoDB_, etc.).
92
-
93
- To wait for all services to be ready:
94
- ```bash
95
- $ make wait
96
- ```
97
-
98
91
  It is recommended that you create a `test` command in your `Makefile` which will launch all dependencies and wait for them to be ready before running all tests. For example:
99
92
 
100
93
  ```Makefile
@@ -34,31 +34,31 @@ module Orchestration
34
34
  update_file(dest, template(template_name))
35
35
  end
36
36
 
37
- def write_file(path, content, options = {})
37
+ def create_file(path, content, options = {})
38
38
  relpath = relative_path(path)
39
39
  overwrite = options.fetch(:overwrite, true)
40
40
  present = File.exist?(path)
41
41
  return @terminal.write(:skip, relpath) if present && !overwrite
42
42
 
43
- File.write(path, content)
43
+ write_file(path, content)
44
44
  @terminal.write(:create, relative_path(path))
45
45
  end
46
46
 
47
47
  def update_file(path, content)
48
48
  present = File.exist?(path)
49
- return write_file(path, content) unless present
49
+ return create_file(path, content) unless present
50
50
 
51
51
  previous_content = File.read(path) if present
52
- File.write(path, content)
53
52
  if present && previous_content == content
54
53
  return @terminal.write(:skip, relative_path(path))
55
54
  end
56
55
 
56
+ File.write(path, content)
57
57
  @terminal.write(:update, relative_path(path))
58
58
  end
59
59
 
60
60
  def append_file(path, content, echo: true)
61
- return write_file(path, content) unless File.exist?(path)
61
+ return create_file(path, content) unless File.exist?(path)
62
62
 
63
63
  File.write(path, content, File.size(path), mode: 'a')
64
64
  @terminal.write(:update, relative_path(path)) if echo
@@ -95,5 +95,10 @@ module Orchestration
95
95
  def read_template(template)
96
96
  File.read(templates_path.join("#{template}.erb"))
97
97
  end
98
+
99
+ def write_file(path, content)
100
+ FileUtils.mkdir_p(File.dirname(path))
101
+ File.write(path, content)
102
+ end
98
103
  end
99
104
  end
@@ -29,7 +29,7 @@ module Orchestration
29
29
  environment = { env: @env, wait_commands: wait_commands }
30
30
  content = template('Makefile', environment)
31
31
  path = @env.orchestration_root.join('Makefile')
32
- path.exist? ? update_file(path, content) : write_file(path, content)
32
+ path.exist? ? update_file(path, content) : create_file(path, content)
33
33
  inject_if_missing(
34
34
  @env.root.join('Makefile'),
35
35
  'include orchestration/Makefile'
@@ -38,7 +38,7 @@ module Orchestration
38
38
 
39
39
  def dockerfile
40
40
  content = template('Dockerfile', ruby_version: RUBY_VERSION)
41
- write_file(
41
+ create_file(
42
42
  orchestration_dir.join('Dockerfile'),
43
43
  content,
44
44
  overwrite: false
@@ -48,7 +48,7 @@ module Orchestration
48
48
  def entrypoint
49
49
  content = template('entrypoint.sh')
50
50
  path = orchestration_dir.join('entrypoint.sh')
51
- write_file(path, content, overwrite: false)
51
+ create_file(path, content, overwrite: false)
52
52
  FileUtils.chmod('a+x', path)
53
53
  end
54
54
 
@@ -66,13 +66,13 @@ module Orchestration
66
66
  return if File.exist?(path)
67
67
 
68
68
  docker_compose = DockerCompose::Services.new(@env, service_configurations)
69
- write_file(path, docker_compose.structure.to_yaml)
69
+ create_file(path, docker_compose.structure.to_yaml)
70
70
  end
71
71
 
72
72
  def unicorn
73
73
  content = template('unicorn.rb')
74
74
  path = @env.root.join('config', 'unicorn.rb')
75
- write_file(path, content, overwrite: false)
75
+ create_file(path, content, overwrite: false)
76
76
  end
77
77
 
78
78
  def yaml_bash
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Orchestration
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orchestration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell