contained 0.4.0 → 0.5.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: 527971bc3fd7a83ceb0cffc2bf5b50ed59e49a3a5b43c4d7068f11194c36e554
4
+ data.tar.gz: 289aa2ca3ae5d3a9b121c186a12302b6a38cc5196fc3fd6c4bb8af94c143cb02
5
5
  SHA512:
6
- metadata.gz: 20db27de1725d9aceffaa923e919315b12beb3f1ec7bedc969af903da579f491fd087ce90fa4c86edbf40a88f4898537f9b3419649159a2c3a17ab739edcc6b5
7
- data.tar.gz: 3781c551e71dd8ae8e0fd81bf38d07c9e75b64d1f08eb8371359a409575c86636383fc0ec7428f1fe6fb29a41079fb315ff0aee050e5ca71acb1d593dfa561c6
6
+ metadata.gz: bf6504165dc79786708c23074deb59f7007a233a43eaf3bbf8ae671ba6774b0e534691c5949a787a877a733460567430b5ba79cf741e3a12514ec9ed38e09566
7
+ data.tar.gz: d9b6657138f0d35a9538e3595ee3ef65648ea0a3da8dc61ed4720273a1059adc4169d9830374d4de01f1356bb3598d8e3607292e94febd7602830f37a26e0b13
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
@@ -11,9 +11,9 @@ module Contained
11
11
  deploy_compose_yml = File.open("./config/deploy/compose.yml")
12
12
  deploy_env = File.open("./config/deploy/.#{@environment}.env")
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.5.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.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre