beam_up 0.5.0 → 0.6.0
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/beam_up/cli.rb +8 -1
- data/lib/beam_up/configuration.rb +1 -1
- data/lib/beam_up/core.rb +16 -8
- data/lib/beam_up/version.rb +1 -1
- data/lib/beam_up.rb +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b10eded0c9811a845155eaaa6a83ccfc37d958ce58e59ec30a3b022f8fbc13b6
|
|
4
|
+
data.tar.gz: adc80ce6a37bf79bc0db5d055c574ab114968d8049eb3a7b9a27cf09596c0fda
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33588c7eca1e972fcb51ee9d0fa5356920d1551a0d16ba73498551b74dd3c6c6fbbdb164b8de7e15e95270d9950ed418ae50c68372b7fe70dacd378e3fad1645
|
|
7
|
+
data.tar.gz: aa8624dc95de22e7ad7e915b78c0cb9b994d7f5920723c4d24d0e1cf63b08bf03ad54d345dbfb3ace3af794d97d317b93e6762be3beb773e4bcf4b15a194607a
|
data/lib/beam_up/cli.rb
CHANGED
|
@@ -10,6 +10,7 @@ module BeamUp
|
|
|
10
10
|
def initialize(arguments)
|
|
11
11
|
@arguments = arguments
|
|
12
12
|
@provider = nil
|
|
13
|
+
@config_file = nil
|
|
13
14
|
end
|
|
14
15
|
|
|
15
16
|
def run
|
|
@@ -81,7 +82,7 @@ module BeamUp
|
|
|
81
82
|
def deploy
|
|
82
83
|
input = parse_options
|
|
83
84
|
|
|
84
|
-
beamed = BeamUp.deploy! input, provider: @provider
|
|
85
|
+
beamed = BeamUp.deploy! input, provider: @provider, config_file: @config_file
|
|
85
86
|
|
|
86
87
|
puts beamed.message
|
|
87
88
|
puts "Deploy ID: #{beamed.deploy_id}" if beamed.deploy_id
|
|
@@ -150,11 +151,13 @@ module BeamUp
|
|
|
150
151
|
beam_up [FOLDER] # Deploy using .beam_up.yml config
|
|
151
152
|
beam_up [FOLDER] --to PROVIDER # Deploy with provider override
|
|
152
153
|
beam_up [FOLDER] --provider PROVIDER # Alias for --to
|
|
154
|
+
beam_up [FOLDER] --config FILE # Use a specific config file
|
|
153
155
|
|
|
154
156
|
Examples:
|
|
155
157
|
beam_up init netlify
|
|
156
158
|
beam_up ./output
|
|
157
159
|
beam_up ./output --to aws_s3
|
|
160
|
+
beam_up ./output --config /path/to/config.yml
|
|
158
161
|
HELP
|
|
159
162
|
|
|
160
163
|
exit
|
|
@@ -174,6 +177,10 @@ module BeamUp
|
|
|
174
177
|
@provider = value
|
|
175
178
|
end
|
|
176
179
|
|
|
180
|
+
options.on("--config FILE", "Use a specific config file") do |value|
|
|
181
|
+
@config_file = value
|
|
182
|
+
end
|
|
183
|
+
|
|
177
184
|
options.on("--help", "-h", "Show this help") do
|
|
178
185
|
help
|
|
179
186
|
|
data/lib/beam_up/core.rb
CHANGED
|
@@ -5,16 +5,23 @@ require "yaml"
|
|
|
5
5
|
module BeamUp
|
|
6
6
|
class Core
|
|
7
7
|
class << self
|
|
8
|
-
def configure
|
|
8
|
+
def configure(&block)
|
|
9
9
|
yield(configuration)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
attr_writer :config_file
|
|
13
|
+
|
|
14
|
+
def configuration(config_file: nil)
|
|
15
|
+
@configuration ||= begin
|
|
16
|
+
custom_path = config_file || @config_file || ((@configuration&.config_file && File.exist?(@configuration.config_file)) ? @configuration.config_file : nil)
|
|
17
|
+
config = custom_path ? configuration_file(custom_path) : configuration_file
|
|
18
|
+
|
|
19
|
+
config || raise(ConfigurationError, "No .beam_up.yml found. Run `beam_up init PROVIDER` to create one.")
|
|
20
|
+
end
|
|
14
21
|
end
|
|
15
22
|
|
|
16
|
-
def deploy!(path = nil, provider: nil)
|
|
17
|
-
config =
|
|
23
|
+
def deploy!(path = nil, provider: nil, config_file: nil)
|
|
24
|
+
config = configuration(config_file: config_file)
|
|
18
25
|
config.provider = provider if provider
|
|
19
26
|
|
|
20
27
|
deploy_path = path || config.path || raise(ConfigurationError, "No path specified")
|
|
@@ -33,9 +40,10 @@ module BeamUp
|
|
|
33
40
|
|
|
34
41
|
private
|
|
35
42
|
|
|
36
|
-
def configuration_file
|
|
37
|
-
file = ["config/beam_up.yml", ".beam_up.yml"].find { File.exist?(it) }
|
|
38
|
-
|
|
43
|
+
def configuration_file(custom_path = nil)
|
|
44
|
+
file = custom_path || ["config/beam_up.yml", ".beam_up.yml"].find { File.exist?(it) }
|
|
45
|
+
|
|
46
|
+
return nil unless file && File.exist?(file)
|
|
39
47
|
|
|
40
48
|
data = YAML.safe_load_file(file)
|
|
41
49
|
|
data/lib/beam_up/version.rb
CHANGED
data/lib/beam_up.rb
CHANGED
|
@@ -24,8 +24,12 @@ module BeamUp
|
|
|
24
24
|
class << self
|
|
25
25
|
def configure(&block) = Core.configure(&block)
|
|
26
26
|
|
|
27
|
-
def
|
|
27
|
+
def config_file=(path)
|
|
28
|
+
Core.config_file = path
|
|
29
|
+
end
|
|
28
30
|
|
|
29
|
-
def
|
|
31
|
+
def configuration(config_file: nil) = Core.configuration(config_file: config_file)
|
|
32
|
+
|
|
33
|
+
def deploy!(path = nil, provider: nil, to: nil, config_file: nil) = Core.deploy!(path, provider: (to || provider)&.to_s, config_file: config_file)
|
|
30
34
|
end
|
|
31
35
|
end
|