firespring_dev_commands 1.5.3.pre.alpha.1 → 1.5.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 060f037868598436e3f670ca01a2fdbd3f6bc42148695c7f2b26d1570884d52d
|
4
|
+
data.tar.gz: 7deeb476f01d1e2dcb1a730c15ebecc529f6d568bbfafaf6e9e7e5333ed14ef9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a30f757615b686dca3c7c6fca8b2f5b034a2591c4fd6ce86f149a75351c473fa09da301fc10cb5fba014f332e6aacc22170cd6be768e0101095293865fd226fe
|
7
|
+
data.tar.gz: 939a251e7bfd47ee62af90838ba8e6eaa4d334ca05b2462ba4605c9314e1e6d29fc176f8d7e978923a3ca6385d4571cf5ab8ce431075f23973784b401ae6563f
|
@@ -8,9 +8,8 @@ module Dev
|
|
8
8
|
# Class containing methods for interfacing with the docker compose cli
|
9
9
|
class Compose
|
10
10
|
# Config object for setting top level docker compose config options
|
11
|
-
Config = Struct.new(:
|
11
|
+
Config = Struct.new(:project_dir, :project_name, :compose_files, :min_version, :max_version) do
|
12
12
|
def initialize
|
13
|
-
self.executable_name = EXECUTABLE_NAME
|
14
13
|
self.project_dir = DEV_COMMANDS_ROOT_DIR
|
15
14
|
self.project_name = DEV_COMMANDS_PROJECT_NAME
|
16
15
|
self.compose_files = ["#{DEV_COMMANDS_ROOT_DIR}/docker-compose.yml"]
|
@@ -70,12 +69,12 @@ module Dev
|
|
70
69
|
# Checks the min and max version against the current docker version if they have been configured
|
71
70
|
def check_version
|
72
71
|
min_version = self.class.config.min_version
|
73
|
-
|
74
|
-
|
72
|
+
raise "requires #{EXECUTABLE_NAME} version >= #{min_version} (found #{self.class.version})" if min_version &&
|
73
|
+
!Dev::Common.new.version_greater_than(min_version, self.class.version)
|
75
74
|
|
76
75
|
max_version = self.class.config.max_version
|
77
|
-
|
78
|
-
|
76
|
+
raise "requires #{EXECUTABLE_NAME} version < #{max_version} (found #{self.class.version})" if max_version &&
|
77
|
+
Dev::Common.new.version_greater_than(max_version, self.class.version)
|
79
78
|
end
|
80
79
|
|
81
80
|
# Pull in supported env settings and call build
|
@@ -84,7 +83,6 @@ module Dev
|
|
84
83
|
def build
|
85
84
|
merge_options('--parallel')
|
86
85
|
merge_env_pull_option
|
87
|
-
merge_env_push_option
|
88
86
|
merge_env_cache_option
|
89
87
|
execute_command(build_command('build'))
|
90
88
|
end
|
@@ -183,13 +181,6 @@ module Dev
|
|
183
181
|
merge_options('--pull') if ENV['PULL'].to_s.strip == 'true'
|
184
182
|
end
|
185
183
|
|
186
|
-
# Merge --push option if PUSH is set to true and no existing push options are present
|
187
|
-
private def merge_env_push_option
|
188
|
-
return if @options.any? { |it| it.include?('push') }
|
189
|
-
|
190
|
-
merge_options('--push') if ENV['PUSH'].to_s.strip == 'true'
|
191
|
-
end
|
192
|
-
|
193
184
|
# Merge --no-build option unless BUILD is set to true and no existing build options are present
|
194
185
|
private def merge_env_build_option
|
195
186
|
return if @options.any? { |it| it.include?('build') }
|
@@ -239,7 +230,7 @@ module Dev
|
|
239
230
|
|
240
231
|
# Build the compose command with the given inputs
|
241
232
|
private def build_command(action, *cmd)
|
242
|
-
command =
|
233
|
+
command = [EXECUTABLE_NAME]
|
243
234
|
command << '--project-directory' << project_dir
|
244
235
|
command << '-p' << project_name if project_name
|
245
236
|
Array(compose_files).compact.each { |file| command << '-f' << file }
|
@@ -201,6 +201,8 @@ module Dev
|
|
201
201
|
private def image_info(image)
|
202
202
|
[].tap do |ary|
|
203
203
|
arch = image.json&.dig('Architecture')
|
204
|
+
variant = image.json&.dig('Variant')
|
205
|
+
arch = "#{arch}/#{variant}" if variant
|
204
206
|
id = image.info&.dig('id')&.split(':')&.last&.slice(0..11)
|
205
207
|
created = timesince(Time.at(image.info&.dig('Created')))
|
206
208
|
size = filesize(image.info&.dig('Size'))
|
@@ -253,7 +255,10 @@ module Dev
|
|
253
255
|
private def container_info(container)
|
254
256
|
id = container.id&.slice(0..11)
|
255
257
|
image = container.info&.dig('Image')
|
256
|
-
|
258
|
+
image_json = ::Docker::Image.get(image).json
|
259
|
+
arch = image_json&.dig('Architecture')
|
260
|
+
variant = image_json&.dig('Variant')
|
261
|
+
arch = "#{arch}/#{variant}" if variant
|
257
262
|
command = container.info&.dig('Command')
|
258
263
|
created = timesince(Time.at(container.info&.dig('Created')))
|
259
264
|
status = container.info&.dig('Status')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firespring_dev_commands
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.3
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -453,9 +453,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
453
453
|
version: '2.7'
|
454
454
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
455
455
|
requirements:
|
456
|
-
- - "
|
456
|
+
- - ">="
|
457
457
|
- !ruby/object:Gem::Version
|
458
|
-
version:
|
458
|
+
version: '0'
|
459
459
|
requirements: []
|
460
460
|
rubygems_version: 3.1.6
|
461
461
|
signing_key:
|