fly.io-rails 0.0.19-x86_64-darwin → 0.0.20-x86_64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/x86_64-darwin/flyctl +0 -0
- data/lib/fly.io-rails/machines.rb +11 -6
- data/lib/fly.io-rails/version.rb +1 -1
- data/lib/generators/templates/main.tf.erb +9 -1
- data/lib/generators/terraform_generator.rb +2 -0
- data/lib/tasks/fly.rake +4 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a7dcc8e3cb676412613e409cab2e30faea300a076d94e2111d072055ecf68c8
|
4
|
+
data.tar.gz: 341bddcd7a49739441f9d8c84f07417740c913f9870b4ad3b01f93ac8547f7d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1248898f8d43835025988a9c6f78dfa8ef64d744e60c75e68d120490e68f1af8673296807b1afd59d976f857a09a878347568bf22b7e443d01dce4113d57e504
|
7
|
+
data.tar.gz: fae2ff3b054f8ad1fdff4a9223fbfb3107bbc0489f35f036d6bd2947c6ffa2e869f00986726e4cfbd195f03f93d70be070a793510bdfcc7fc2fc907d68ad0c29
|
data/exe/x86_64-darwin/flyctl
CHANGED
Binary file
|
@@ -28,11 +28,8 @@ module Fly
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
# determine
|
32
|
-
def self.
|
33
|
-
hostname = fly_api_hostname
|
34
|
-
return hostname if hostname
|
35
|
-
|
31
|
+
# determine application's organization
|
32
|
+
def self.org
|
36
33
|
org = 'personal'
|
37
34
|
|
38
35
|
if File.exist? 'fly.toml'
|
@@ -46,6 +43,14 @@ module Fly
|
|
46
43
|
end
|
47
44
|
end
|
48
45
|
|
46
|
+
org
|
47
|
+
end
|
48
|
+
|
49
|
+
# determine fly api hostname. Starts proxy if necessary
|
50
|
+
def self.fly_api_hostname!
|
51
|
+
hostname = fly_api_hostname
|
52
|
+
return hostname if hostname
|
53
|
+
|
49
54
|
pid = fork { exec "flyctl machines api-proxy --org #{org}" }
|
50
55
|
at_exit { Process.kill "INT", pid }
|
51
56
|
|
@@ -62,7 +67,7 @@ module Fly
|
|
62
67
|
end
|
63
68
|
end
|
64
69
|
|
65
|
-
@@
|
70
|
+
@@fly_api_hostname
|
66
71
|
end
|
67
72
|
|
68
73
|
# create_fly_application app_name: 'user-functions', org_slug: 'personal'
|
data/lib/fly.io-rails/version.rb
CHANGED
@@ -2,11 +2,19 @@ terraform {
|
|
2
2
|
required_providers {
|
3
3
|
fly = {
|
4
4
|
source = "fly-apps/fly"
|
5
|
-
version = "0.0.
|
5
|
+
version = "0.0.18"
|
6
6
|
}
|
7
7
|
}
|
8
8
|
}
|
9
9
|
|
10
|
+
/* uncomment if you want an internal tunnel
|
11
|
+
provider "fly" {
|
12
|
+
useinternaltunnel = true
|
13
|
+
internaltunnelorg = <%= (@org || "personal").inspect %>
|
14
|
+
internaltunnelregion = <%= (@regions.first || 'iad').inspect %>
|
15
|
+
}
|
16
|
+
*/
|
17
|
+
|
10
18
|
# Allocate an IPv4 address
|
11
19
|
resource "fly_ip" "<%= @appName %>Ipv4" {
|
12
20
|
app = <%= @app.inspect %>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'open3'
|
2
|
+
require 'fly.io-rails/machines'
|
2
3
|
|
3
4
|
class TerraformGenerator < Rails::Generators::Base
|
4
5
|
include FlyIoRails::Utils
|
@@ -35,6 +36,7 @@ class TerraformGenerator < Rails::Generators::Base
|
|
35
36
|
@yarn = File.exist? 'yarn.lock'
|
36
37
|
@node_version = @node ? `node --version`.chomp.sub(/^v/, '') : '16.17.0'
|
37
38
|
@appName = @app.gsub('-', '_').camelcase(:lower)
|
39
|
+
@org = Fly::Machines.org
|
38
40
|
|
39
41
|
template 'Dockerfile.erb', 'Dockerfile'
|
40
42
|
template 'dockerignore.erb', '.dockerignore'
|
data/lib/tasks/fly.rake
CHANGED
@@ -46,6 +46,9 @@ namespace :fly do
|
|
46
46
|
config[:env] ||= {}
|
47
47
|
config[:env]['SERVER_COMMAND'] = 'bin/rails fly:release'
|
48
48
|
|
49
|
+
# start proxy, if necessary
|
50
|
+
endpoint = Fly::Machines::fly_api_hostname!
|
51
|
+
|
49
52
|
# start release machine
|
50
53
|
STDERR.puts "--> #{config[:env]['SERVER_COMMAND']}"
|
51
54
|
start = Fly::Machines.create_start_machine(app, config: config)
|
@@ -75,6 +78,7 @@ namespace :fly do
|
|
75
78
|
|
76
79
|
# use terraform apply to deploy
|
77
80
|
ENV['FLY_API_TOKEN'] = `flyctl auth token`.chomp
|
81
|
+
ENV['FLY_HTTP_ENDPOINT'] = endpoint if endpoint
|
78
82
|
system 'terraform apply -auto-approve'
|
79
83
|
else
|
80
84
|
STDERR.puts 'Error performing release'
|
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.20
|
5
5
|
platform: x86_64-darwin
|
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-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fly-ruby
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: toml
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
description:
|
28
42
|
email: rubys@intertwingly.net
|
29
43
|
executables:
|