fly.io-rails 0.0.20-aarch64-linux → 0.0.21-aarch64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fly.io-rails/actions.rb +66 -0
- data/lib/fly.io-rails/version.rb +1 -1
- data/lib/generators/terraform_generator.rb +3 -14
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb7118dcd0aa38da494ebbda4a81eb170d3e94c952043556c9ece081bfe7f795
|
4
|
+
data.tar.gz: 325196f423704f3a79b3856d780d9a8be8a444862dfb3108e94e2ec9b95b747a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5c144450f970e2fd61e627140d94ccc56a4109f691cf2f50dab4d8d306ca15dd786acb01b472fe244dd3cafe19b7e9d06161804df60cd48954468a223546079
|
7
|
+
data.tar.gz: 76e67290b74f86cdb214335fd4a45b38213ad110afc0e5403b094ed800f1c92eac94dcc6becc5cfb859843ba48a66e6993cb75fa8bb61b0b2de0c914db3c6491
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'active_support'
|
3
|
+
require 'active_support/core_ext/string/inflections'
|
4
|
+
require 'fly.io-rails/machines'
|
5
|
+
|
6
|
+
module Fly
|
7
|
+
class Actions < Thor::Group
|
8
|
+
include Thor::Actions
|
9
|
+
include Thor::Base
|
10
|
+
attr_accessor :options
|
11
|
+
|
12
|
+
def initialize(app = nil)
|
13
|
+
self.app = app if app
|
14
|
+
|
15
|
+
@ruby_version = RUBY_VERSION
|
16
|
+
@bundler_version = Bundler::VERSION
|
17
|
+
@node = File.exist? 'node_modules'
|
18
|
+
@yarn = File.exist? 'yarn.lock'
|
19
|
+
@node_version = @node ? `node --version`.chomp.sub(/^v/, '') : '16.17.0'
|
20
|
+
@org = Fly::Machines.org
|
21
|
+
@regions = []
|
22
|
+
|
23
|
+
@options = {}
|
24
|
+
@destination_stack = [Dir.pwd]
|
25
|
+
end
|
26
|
+
|
27
|
+
def app
|
28
|
+
return @app if @app
|
29
|
+
self.app = TOML.load_file('fly.toml')['app']
|
30
|
+
end
|
31
|
+
|
32
|
+
def app=(app)
|
33
|
+
@app = app
|
34
|
+
@appName = @app.gsub('-', '_').camelcase(:lower)
|
35
|
+
end
|
36
|
+
|
37
|
+
source_paths.push File::expand_path('../generators/templates', __dir__)
|
38
|
+
|
39
|
+
def generate_dockerfile
|
40
|
+
app
|
41
|
+
template 'Dockerfile.erb', 'Dockerfile'
|
42
|
+
end
|
43
|
+
|
44
|
+
def generate_dockerignore
|
45
|
+
app
|
46
|
+
template 'dockerignore.erb', '.dockerignore'
|
47
|
+
end
|
48
|
+
|
49
|
+
def generate_terraform
|
50
|
+
app
|
51
|
+
template 'main.tf.erb', 'main.tf'
|
52
|
+
end
|
53
|
+
|
54
|
+
def generate_raketask
|
55
|
+
app
|
56
|
+
template 'fly.rake.erb', 'lib/tasks/fly.rake'
|
57
|
+
end
|
58
|
+
|
59
|
+
def generate_all
|
60
|
+
generate_dockerfile
|
61
|
+
generate_dockerignore
|
62
|
+
generate_terraform
|
63
|
+
generate_raketask
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
data/lib/fly.io-rails/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'open3'
|
2
|
-
require 'fly.io-rails/
|
2
|
+
require 'fly.io-rails/actions'
|
3
3
|
|
4
4
|
class TerraformGenerator < Rails::Generators::Base
|
5
5
|
include FlyIoRails::Utils
|
@@ -30,18 +30,8 @@ class TerraformGenerator < Rails::Generators::Base
|
|
30
30
|
@regions = options[:regions].flatten
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
@node = File.exist? 'node_modules'
|
36
|
-
@yarn = File.exist? 'yarn.lock'
|
37
|
-
@node_version = @node ? `node --version`.chomp.sub(/^v/, '') : '16.17.0'
|
38
|
-
@appName = @app.gsub('-', '_').camelcase(:lower)
|
39
|
-
@org = Fly::Machines.org
|
40
|
-
|
41
|
-
template 'Dockerfile.erb', 'Dockerfile'
|
42
|
-
template 'dockerignore.erb', '.dockerignore'
|
43
|
-
template 'main.tf.erb', 'main.tf'
|
44
|
-
template 'fly.rake.erb', 'lib/tasks/fly.rake'
|
33
|
+
action = Fly::Actions.new(@app)
|
34
|
+
action.generate_all
|
45
35
|
|
46
36
|
credentials = nil
|
47
37
|
if File.exist? 'config/credentials/production.key'
|
@@ -60,4 +50,3 @@ class TerraformGenerator < Rails::Generators::Base
|
|
60
50
|
tee 'terraform init'
|
61
51
|
end
|
62
52
|
end
|
63
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fly.io-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.21
|
5
5
|
platform: aarch64-linux
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fly-ruby
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- exe/aarch64-linux/flyctl
|
52
52
|
- exe/flyctl
|
53
53
|
- lib/fly.io-rails.rb
|
54
|
+
- lib/fly.io-rails/actions.rb
|
54
55
|
- lib/fly.io-rails/generators.rb
|
55
56
|
- lib/fly.io-rails/hcl.rb
|
56
57
|
- lib/fly.io-rails/machines.rb
|