contained 0.9.0 → 1.1.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: 9cd0f486e60a10bab86075204281d68473e4cb4b68dad6511a8051b3bed42525
4
- data.tar.gz: 915b6f46f9bc11a54a6b8af80f0029a7d38f21e83c6ceb2e0550bd582e66f14e
3
+ metadata.gz: 96f9f333c63a83957664f948f29f644068f096032708f0f1fc940a9b4435c6c9
4
+ data.tar.gz: 7ad54e147e7954500120b66e6c87f6d63960204c53357920f41dfd627edae9b2
5
5
  SHA512:
6
- metadata.gz: 573eaf7a77cccb4cf341d4d957389402f805905200dd09dc45312f1dcd8217eba054961f7a29c9abdc6fc3cc58ac4cdaf9b1dce3d9af37a109813e5d10a1241c
7
- data.tar.gz: fb9b6336368af6a4338325c19ed1a83eaa354822564f59b0c5ba3d4634a1d6615dd4d03d86b03d0c7fb9acab4afe1605aab840d702e7c3e0b546fe3d7418fc9c
6
+ metadata.gz: 6aeae92a097e17cd5d80835f65e22f8b6f4da988c114419399abf1dc48dd9ee2dfad16a0b413288472273bcd09f4da4b42eec9fbc4679a6eda9819a7cb060df3
7
+ data.tar.gz: 854c08002d878cfd29cde97030ee81514211989ee8f3001400cba53884f656c8005f219f103fe3dfe96e4d31c9cc77fd8e965d717bcbbad21d9b759ad1902cd5
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ gemspec
6
6
 
7
7
  gem "irb"
8
8
  gem "rake"
9
+ gem "redcarpet"
9
10
  gem "rspec"
10
11
  gem "rspec_junit_formatter"
11
12
  gem "rubocop"
data/README.md CHANGED
@@ -131,3 +131,11 @@ demo.com {
131
131
  }
132
132
  }
133
133
  ```
134
+
135
+ ### Deploy
136
+
137
+ The `contained deploy` command connects to all the hosts within an environment via SSH and prunes docker then re-deploys the stack.
138
+
139
+ ```bash
140
+ contained deploy --environment production
141
+ ```
@@ -8,7 +8,7 @@ module Contained
8
8
  # @param stdout [IO]
9
9
  # @param argv [Array<String>]
10
10
  def self.handle!(stdin:, stdout:, argv:)
11
- new(stdin: stdin, stdout: stdout, argv: argv).handle!
11
+ new(stdin:, stdout:, argv:).handle!
12
12
  end
13
13
 
14
14
  # @param stdin [IO]
@@ -34,7 +34,7 @@ module Contained
34
34
 
35
35
  # @return [String, nil]
36
36
  def password
37
- @config.dig("registry", "username")
37
+ @config.dig("registry", "password")
38
38
  end
39
39
 
40
40
  # @return [String]
@@ -16,6 +16,7 @@ module Contained
16
16
 
17
17
  on hosts, in: :sequence do
18
18
  execute(:docker, :login, "-u", username, "-p", password) if username && password
19
+ execute(:docker, :system, :prune, "-f")
19
20
 
20
21
  execute(<<~BASH)
21
22
  source ./.contained/#{stack}/.env
@@ -16,6 +16,20 @@ module Contained
16
16
  @stdout.puts("[setup] stack=#{stack} environment=#{@environment}")
17
17
 
18
18
  on hosts, in: :sequence do
19
+ execute(:which, "curl") do |_, _, status|
20
+ if status.exitstatus != 0
21
+ @stdout.puts("missing curl")
22
+ exit(1)
23
+ end
24
+ end
25
+
26
+ execute(:which, "docker") do |_, _, status|
27
+ if status.exitstatus != 0
28
+ @stdout.puts("missing docker")
29
+ execute("curl -sSL https://get.docker.com | sh")
30
+ end
31
+ end
32
+
19
33
  execute(:docker, :login, "-u", username, "-p", password) if username && password
20
34
 
21
35
  execute(:docker, :swarm, :init) unless capture(:docker, :info).include?("Swarm: active")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Contained
4
- VERSION = "0.9.0"
4
+ VERSION = "1.1.0"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contained
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-24 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: erb
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 3.6.6
147
+ rubygems_version: 3.6.9
148
148
  specification_version: 4
149
149
  summary: Docker / Swarm / SSH
150
150
  test_files: []