contained 0.4.0 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0cb59a30f87b9f812ea82750eaf3ec2aa709646117f2bd3cd267b74a0a93f4b
4
- data.tar.gz: 3f0de08deaa75360d26125eaf1c3e82a1c068a2357eb93d69f9bb15ebe9b7ac8
3
+ metadata.gz: 4175520c4ec751558d7d28563a476fcc23eb3f46ee06bac71580fb77312aaae4
4
+ data.tar.gz: b30a71a1728939c95220ddcd62f037051451d76b8d9bb201d18824ff4dd14b38
5
5
  SHA512:
6
- metadata.gz: 20db27de1725d9aceffaa923e919315b12beb3f1ec7bedc969af903da579f491fd087ce90fa4c86edbf40a88f4898537f9b3419649159a2c3a17ab739edcc6b5
7
- data.tar.gz: 3781c551e71dd8ae8e0fd81bf38d07c9e75b64d1f08eb8371359a409575c86636383fc0ec7428f1fe6fb29a41079fb315ff0aee050e5ca71acb1d593dfa561c6
6
+ metadata.gz: 3828f26f88c6de1cfb04973053ea874ed3d2d26697bad3196fbcd65c164bc2d0c2e0ae67f3fd64053d1694acc3dcd5481e12f00862a14aa62e8d666a8613b1b4
7
+ data.tar.gz: 2243642c5d055fce876311a111945cc75895f2d6f924c3c20c2b46b79d1499b05152cb5f40f96eb7e0e2317c49478a6cceac55fd300085fc34d4227f2622b861
data/README.md CHANGED
@@ -8,14 +8,12 @@
8
8
  stack: example
9
9
 
10
10
  environments:
11
- production:
12
- servers:
13
- - 1.2.3.4
14
- - 5.6.7.8
15
- test:
16
- servers:
17
- - 4.3.2.1
18
- - 8.7.6.5
11
+ production: hosts
12
+ - 1.2.3.4
13
+ - 5.6.7.8
14
+ test: hosts
15
+ - 4.3.2.1
16
+ - 8.7.6.5
19
17
 
20
18
  config:
21
19
  services:
@@ -34,11 +34,11 @@ module Contained
34
34
 
35
35
  environments:
36
36
  production:
37
- servers:
37
+ hosts
38
38
  - 1.2.3.4
39
39
  - 5.6.7.8
40
40
  test:
41
- servers:
41
+ hosts
42
42
  - 4.3.2.1
43
43
  - 8.7.6.5
44
44
  YAML
@@ -29,8 +29,11 @@ module Contained
29
29
 
30
30
  protected
31
31
 
32
- def servers
33
- @config.dig("environments", @environment, "servers")
32
+ # @return [Array<Hash>]
33
+ def hosts
34
+ @config.dig("environments", @environment, "hosts").map do |hostname|
35
+ @config.fetch("ssh", {}).merge({ hostname: })
36
+ end
34
37
  end
35
38
  end
36
39
  end
@@ -12,7 +12,7 @@ module Contained
12
12
 
13
13
  @stdout.puts("[deploying] stack=#{stack} environment=#{@environment}")
14
14
 
15
- on servers, in: :sequence do |host|
15
+ on hosts, in: :sequence do |host|
16
16
  puts("[starting] host=#{host.hostname}")
17
17
  execute(<<~BASH)
18
18
  source ./.contained/#{stack}/.env
@@ -9,11 +9,11 @@ module Contained
9
9
  stack = @config.fetch("stack")
10
10
 
11
11
  deploy_compose_yml = File.open("./config/deploy/compose.yml")
12
- deploy_env = File.open("./config/deploy/.#{@environment}.env")
12
+ deploy_env = File.open("./config/deploy/.env.#{@environment}")
13
13
 
14
- @stdout.puts("[setup] stack=#{stack} environment=#{@environment} servers=#{servers}")
14
+ @stdout.puts("[setup] stack=#{stack} environment=#{@environment} hosts=#{hosts}")
15
15
 
16
- on servers, in: :sequence do |host|
16
+ on hosts, in: :sequence do |host|
17
17
  puts("[starting] host=#{host.hostname}")
18
18
 
19
19
  execute("mkdir -p ./.contained/#{stack}")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Contained
4
- VERSION = "0.4.0"
4
+ VERSION = "0.6.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contained
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre