mrsk 0.9.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +158 -13
- data/lib/mrsk/cli/accessory.rb +87 -64
- data/lib/mrsk/cli/app.rb +103 -65
- data/lib/mrsk/cli/base.rb +46 -9
- data/lib/mrsk/cli/build.rb +40 -30
- data/lib/mrsk/cli/lock.rb +37 -0
- data/lib/mrsk/cli/main.rb +91 -49
- data/lib/mrsk/cli/prune.rb +14 -8
- data/lib/mrsk/cli/server.rb +9 -7
- data/lib/mrsk/cli/templates/deploy.yml +2 -0
- data/lib/mrsk/cli/traefik.rb +37 -21
- data/lib/mrsk/commander.rb +40 -34
- data/lib/mrsk/commands/accessory.rb +9 -6
- data/lib/mrsk/commands/app.rb +39 -37
- data/lib/mrsk/commands/auditor.rb +20 -5
- data/lib/mrsk/commands/base.rb +6 -4
- data/lib/mrsk/commands/builder/base.rb +1 -0
- data/lib/mrsk/commands/builder/native.rb +2 -1
- data/lib/mrsk/commands/healthcheck.rb +5 -3
- data/lib/mrsk/commands/lock.rb +63 -0
- data/lib/mrsk/commands/traefik.rb +13 -7
- data/lib/mrsk/configuration/accessory.rb +53 -7
- data/lib/mrsk/configuration/role.rb +13 -4
- data/lib/mrsk/configuration.rb +59 -17
- data/lib/mrsk/utils.rb +18 -2
- data/lib/mrsk/version.rb +1 -1
- data/lib/mrsk.rb +1 -0
- metadata +47 -3
data/lib/mrsk/utils.rb
CHANGED
@@ -24,8 +24,19 @@ module Mrsk::Utils
|
|
24
24
|
end
|
25
25
|
|
26
26
|
# Returns a list of shell-dashed option arguments. If the value is true, it's treated like a value-less option.
|
27
|
-
def optionize(args)
|
28
|
-
|
27
|
+
def optionize(args, with: nil)
|
28
|
+
options = if with
|
29
|
+
flatten_args(args).collect { |(key, value)| value == true ? "--#{key}" : "--#{key}#{with}#{escape_shell_value(value)}" }
|
30
|
+
else
|
31
|
+
flatten_args(args).collect { |(key, value)| [ "--#{key}", value == true ? nil : escape_shell_value(value) ] }
|
32
|
+
end
|
33
|
+
|
34
|
+
options.flatten.compact
|
35
|
+
end
|
36
|
+
|
37
|
+
# Flattens a one-to-many structure into an array of two-element arrays each containing a key-value pair
|
38
|
+
def flatten_args(args)
|
39
|
+
args.flat_map { |key, value| value.try(:map) { |entry| [key, entry] } || [ [ key, value ] ] }
|
29
40
|
end
|
30
41
|
|
31
42
|
# Copied from SSHKit::Backend::Abstract#redact to be available inside Commands classes
|
@@ -37,4 +48,9 @@ module Mrsk::Utils
|
|
37
48
|
def escape_shell_value(value)
|
38
49
|
value.to_s.dump.gsub(/`/, '\\\\`')
|
39
50
|
end
|
51
|
+
|
52
|
+
# Abbreviate a git revhash for concise display
|
53
|
+
def abbreviate_version(version)
|
54
|
+
version[0...7] if version
|
55
|
+
end
|
40
56
|
end
|
data/lib/mrsk/version.rb
CHANGED
data/lib/mrsk.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mrsk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -108,6 +108,48 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '1.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: debug
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: mocha
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: railties
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
111
153
|
description:
|
112
154
|
email: dhh@hey.com
|
113
155
|
executables:
|
@@ -125,6 +167,7 @@ files:
|
|
125
167
|
- lib/mrsk/cli/base.rb
|
126
168
|
- lib/mrsk/cli/build.rb
|
127
169
|
- lib/mrsk/cli/healthcheck.rb
|
170
|
+
- lib/mrsk/cli/lock.rb
|
128
171
|
- lib/mrsk/cli/main.rb
|
129
172
|
- lib/mrsk/cli/prune.rb
|
130
173
|
- lib/mrsk/cli/registry.rb
|
@@ -145,6 +188,7 @@ files:
|
|
145
188
|
- lib/mrsk/commands/builder/native.rb
|
146
189
|
- lib/mrsk/commands/builder/native/remote.rb
|
147
190
|
- lib/mrsk/commands/healthcheck.rb
|
191
|
+
- lib/mrsk/commands/lock.rb
|
148
192
|
- lib/mrsk/commands/prune.rb
|
149
193
|
- lib/mrsk/commands/registry.rb
|
150
194
|
- lib/mrsk/commands/traefik.rb
|
@@ -173,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
217
|
- !ruby/object:Gem::Version
|
174
218
|
version: '0'
|
175
219
|
requirements: []
|
176
|
-
rubygems_version: 3.4.
|
220
|
+
rubygems_version: 3.4.8
|
177
221
|
signing_key:
|
178
222
|
specification_version: 4
|
179
223
|
summary: Deploy web apps in containers to servers running Docker with zero downtime.
|