firespring_dev_commands 2.0.0.pre.alpha.2 → 2.0.1.pre.alpha.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74827accfb664c9f4170d5e6f0daa426963d0ae1aed9ebccae0b2d971c34923a
|
4
|
+
data.tar.gz: 4dc09342dd87e31c76b68675b910787f6f4a23752a0a9546d15b80e67befdee3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae83b7b87ab131bca8958bd6c2e84e5a14bda7b0588f107d8199d93684fe47146683c3097f6d5add843db1caa1c7f511d321916dac9142528fd22a7326962f5d
|
7
|
+
data.tar.gz: da782857eb8a4a06b0468e66bf3565a908961bd18fe7e9d3b12779feab97d2f5b4fa53997d3fad169c9c99e46a777707619616c188353d77888517906107befc
|
@@ -8,8 +8,9 @@ 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(:project_dir, :project_name, :compose_files, :min_version, :max_version) do
|
11
|
+
Config = Struct.new(:executable_name, :project_dir, :project_name, :compose_files, :min_version, :max_version) do
|
12
12
|
def initialize
|
13
|
+
self.executable_name = EXECUTABLE_NAME
|
13
14
|
self.project_dir = DEV_COMMANDS_ROOT_DIR
|
14
15
|
self.project_name = DEV_COMMANDS_PROJECT_NAME
|
15
16
|
self.compose_files = ["#{DEV_COMMANDS_ROOT_DIR}/docker-compose.yml"]
|
@@ -69,12 +70,12 @@ module Dev
|
|
69
70
|
# Checks the min and max version against the current docker version if they have been configured
|
70
71
|
def check_version
|
71
72
|
min_version = self.class.config.min_version
|
72
|
-
|
73
|
-
|
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
|
74
75
|
|
75
76
|
max_version = self.class.config.max_version
|
76
|
-
|
77
|
-
|
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
|
78
79
|
end
|
79
80
|
|
80
81
|
# Pull in supported env settings and call build
|
@@ -83,6 +84,7 @@ module Dev
|
|
83
84
|
def build
|
84
85
|
merge_options('--parallel')
|
85
86
|
merge_env_pull_option
|
87
|
+
merge_env_push_option
|
86
88
|
merge_env_cache_option
|
87
89
|
execute_command(build_command('build'))
|
88
90
|
end
|
@@ -181,6 +183,13 @@ module Dev
|
|
181
183
|
merge_options('--pull') if ENV['PULL'].to_s.strip == 'true'
|
182
184
|
end
|
183
185
|
|
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
|
+
|
184
193
|
# Merge --no-build option unless BUILD is set to true and no existing build options are present
|
185
194
|
private def merge_env_build_option
|
186
195
|
return if @options.any? { |it| it.include?('build') }
|
@@ -230,7 +239,7 @@ module Dev
|
|
230
239
|
|
231
240
|
# Build the compose command with the given inputs
|
232
241
|
private def build_command(action, *cmd)
|
233
|
-
command =
|
242
|
+
command = self.class.config.executable_name.split(/\s+/)
|
234
243
|
command << '--project-directory' << project_dir
|
235
244
|
command << '-p' << project_name if project_name
|
236
245
|
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.
|
4
|
+
version: 2.0.1.pre.alpha.1
|
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-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|