firespring_dev_commands 2.0.1.pre.alpha.1 → 2.0.1.pre.alpha.2
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 +4 -4
- data/lib/firespring_dev_commands/docker/compose.rb +10 -11
- data/lib/firespring_dev_commands/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ab3da39b3b9d7336453745fafa4a50563e03a90e785c29d3bf7cd17543322da
|
4
|
+
data.tar.gz: 79b31dec877f099d7ef6d7444ce44563828bd305a790bd943da3d55ca29f2044
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79c3ddcc441e1a943b2fe9ca412e1b3a00eb85d49e7469b67720fc910dfdab492b40d6f9148e76c265922458734e382ffb8b45d38993e1661b95e2dd81dbebdc
|
7
|
+
data.tar.gz: bf74bb5fc32c3841c6c41562aac41ecc6d2f145f615f8759fe18a79b3bbeb6da9bb77eefa84bd6a638fa4529b436627a70c802cbc08a31c3edc74f0603508698
|
@@ -7,14 +7,16 @@ module Dev
|
|
7
7
|
class Docker
|
8
8
|
# Class containing methods for interfacing with the docker compose cli
|
9
9
|
class Compose
|
10
|
+
# The name of the docker compose executable
|
11
|
+
EXECUTABLE_NAME = %w(docker compose).freeze
|
12
|
+
|
10
13
|
# Config object for setting top level docker compose config options
|
11
|
-
Config = Struct.new(:
|
14
|
+
Config = Struct.new(:project_dir, :project_name, :compose_files, :min_version, :max_version) do
|
12
15
|
def initialize
|
13
|
-
self.executable_name = EXECUTABLE_NAME
|
14
16
|
self.project_dir = DEV_COMMANDS_ROOT_DIR
|
15
17
|
self.project_name = DEV_COMMANDS_PROJECT_NAME
|
16
18
|
self.compose_files = ["#{DEV_COMMANDS_ROOT_DIR}/docker-compose.yml"]
|
17
|
-
self.min_version =
|
19
|
+
self.min_version = '2.0.0'
|
18
20
|
self.max_version = nil
|
19
21
|
end
|
20
22
|
end
|
@@ -34,14 +36,11 @@ module Dev
|
|
34
36
|
|
35
37
|
# Returns the version of the docker-compose executable on the system
|
36
38
|
def version
|
37
|
-
|
39
|
+
version_cmd = EXECUTABLE_NAME.dup << 'version'
|
40
|
+
@version ||= `#{version_cmd.join(' ')}`.match(/version v?([0-9.]+)/)[1]
|
38
41
|
end
|
39
42
|
end
|
40
43
|
|
41
|
-
# @todo Change this to "docker compose" when everyone is off v1
|
42
|
-
# The name of the docker compose executable
|
43
|
-
EXECUTABLE_NAME = 'docker-compose'.freeze
|
44
|
-
|
45
44
|
attr_accessor :capture, :compose_files, :environment, :options, :project_dir, :project_name, :services, :user, :volumes
|
46
45
|
|
47
46
|
def initialize(
|
@@ -71,11 +70,11 @@ module Dev
|
|
71
70
|
def check_version
|
72
71
|
min_version = self.class.config.min_version
|
73
72
|
version_too_low = min_version && !Dev::Common.new.version_greater_than(min_version, self.class.version)
|
74
|
-
raise "requires
|
73
|
+
raise "requires docker compose version >= #{min_version} (found #{self.class.version})" if version_too_low
|
75
74
|
|
76
75
|
max_version = self.class.config.max_version
|
77
76
|
version_too_high = max_version && Dev::Common.new.version_greater_than(max_version, self.class.version)
|
78
|
-
raise "requires
|
77
|
+
raise "requires docker compose version < #{max_version} (found #{self.class.version})" if version_too_high
|
79
78
|
end
|
80
79
|
|
81
80
|
# Pull in supported env settings and call build
|
@@ -239,7 +238,7 @@ module Dev
|
|
239
238
|
|
240
239
|
# Build the compose command with the given inputs
|
241
240
|
private def build_command(action, *cmd)
|
242
|
-
command =
|
241
|
+
command = EXECUTABLE_NAME.dup
|
243
242
|
command << '--project-directory' << project_dir
|
244
243
|
command << '-p' << project_name if project_name
|
245
244
|
Array(compose_files).compact.each { |file| command << '-f' << file }
|
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: 2.0.1.pre.alpha.
|
4
|
+
version: 2.0.1.pre.alpha.2
|
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-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|