firespring_dev_commands 1.5.3.pre.alpha.1 → 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f703243393c3aeb663185817f26c14f1fd4eda7cdb671f5e8c0ee0d5ea2168b2
4
- data.tar.gz: a0d3b4685a4890ee5be25c917031430c46a09cf972ccd127439691871b471a8a
3
+ metadata.gz: 060f037868598436e3f670ca01a2fdbd3f6bc42148695c7f2b26d1570884d52d
4
+ data.tar.gz: 7deeb476f01d1e2dcb1a730c15ebecc529f6d568bbfafaf6e9e7e5333ed14ef9
5
5
  SHA512:
6
- metadata.gz: 7ae4a74026fc432fb85eb442db2200a8ba066c85a84b64758b889e3cea0f13402fc4a00d68d7a4df7a95498dba195cb411d252c3893447b3af7f8878b47efa6b
7
- data.tar.gz: 45e922ae773aafb01b318e006936780e3239ff345e7d32d515e9b6f47cfa05dccb6fedd89745ce71c0b7bc48c7fb1909c647d6c09b23327cf442d44b471d1c09
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(:executable_name, :project_dir, :project_name, :compose_files, :min_version, :max_version) do
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
- version_too_low = min_version && !Dev::Common.new.version_greater_than(min_version, self.class.version)
74
- raise "requires #{self.class.config.executable_name} version >= #{min_version} (found #{self.class.version})" if version_too_low
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
- version_too_high = max_version && Dev::Common.new.version_greater_than(max_version, self.class.version)
78
- raise "requires #{self.class.config.executable_name} version < #{max_version} (found #{self.class.version})" if version_too_high
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 = self.class.config.executable_name.split(/\s+/)
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
- arch = ::Docker::Image.get(image).json&.dig('Architecture')
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')
@@ -6,6 +6,6 @@ module Dev
6
6
  # Use 'v.v.v.pre.alpha.v' for pre-release vesions
7
7
  # Use 'v.v.v.beta.v for beta versions
8
8
  # Use semantic versioning for any releases (https://semver.org/)
9
- VERSION = '1.5.3.pre.alpha.1'.freeze
9
+ VERSION = '1.5.3'.freeze
10
10
  end
11
11
  end
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.pre.alpha.1
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-05 00:00:00.000000000 Z
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: 1.3.1
458
+ version: '0'
459
459
  requirements: []
460
460
  rubygems_version: 3.1.6
461
461
  signing_key: