fly.io-rails 0.1.17-arm64-darwin → 0.1.19-arm64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/arm64-darwin/flyctl +0 -0
- data/lib/fly.io-rails/actions.rb +24 -16
- data/lib/fly.io-rails/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: 3c377a9ad2cc1b010d8ce03e8ab13102188a78577c3a3f6324cabb7a7f26d7ad
|
4
|
+
data.tar.gz: 8433d90ec57bf0ce16c039f8319daf15c7bdc4aacf719f7d07acc63635a1a6eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac7e4a4a9364564bdd466297a6aadca1b0279c9f9f8cca4a71d26ccd66456ef2f4c0645cdb9dfa46dfc80e62a7d6d9e509fb4ce99df3bec9af6dde9df43864c0
|
7
|
+
data.tar.gz: 2a3a4538ea643f7cf5cf5dc5e818767f2e5c4952eb76f155c24eceb5cfde30f5582e307534409c30b56f4506846c874a96762b79101360f0d7576835707376bc
|
data/exe/arm64-darwin/flyctl
CHANGED
Binary file
|
data/lib/fly.io-rails/actions.rb
CHANGED
@@ -237,8 +237,8 @@ module Fly
|
|
237
237
|
output[%r{redis://\S+}]
|
238
238
|
end
|
239
239
|
|
240
|
-
def release(app,
|
241
|
-
start = Fly::Machines.create_and_start_machine(app,
|
240
|
+
def release(app, options)
|
241
|
+
start = Fly::Machines.create_and_start_machine(app, options)
|
242
242
|
machine = start[:id]
|
243
243
|
|
244
244
|
if not machine
|
@@ -322,9 +322,6 @@ module Fly
|
|
322
322
|
|
323
323
|
# default config
|
324
324
|
config = {
|
325
|
-
region: @region,
|
326
|
-
app: app,
|
327
|
-
name: "#{app}-machine",
|
328
325
|
image: image,
|
329
326
|
guest: {
|
330
327
|
cpus: @config.machine.cpus,
|
@@ -353,7 +350,7 @@ module Fly
|
|
353
350
|
|
354
351
|
# perform release
|
355
352
|
say_status :fly, release_config[:env]['SERVER_COMMAND']
|
356
|
-
event, exit_code, machine = release(app, release_config)
|
353
|
+
event, exit_code, machine = release(app, region: @region, config: release_config)
|
357
354
|
|
358
355
|
if exit_code != 0
|
359
356
|
STDERR.puts 'Error performing release'
|
@@ -368,13 +365,15 @@ module Fly
|
|
368
365
|
|
369
366
|
# stop previous instances - list will fail on first run
|
370
367
|
stdout, stderr, status = Open3.capture3('fly machines list --json')
|
368
|
+
existing_machines = []
|
371
369
|
unless stdout.empty?
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
370
|
+
JSON.parse(stdout).each do |list|
|
371
|
+
existing_machines << list['name']
|
372
|
+
next if list['id'] == machine or list['state'] == 'destroyed'
|
373
|
+
cmd = "fly machines remove --force #{list['id']}"
|
374
|
+
say_status :run, cmd
|
375
|
+
system cmd
|
376
|
+
end
|
378
377
|
end
|
379
378
|
|
380
379
|
# configure sqlite3 (can be overridden by fly.toml)
|
@@ -410,19 +409,28 @@ module Fly
|
|
410
409
|
|
411
410
|
# start app
|
412
411
|
machines = {}
|
412
|
+
options = {region: @region, config: config}
|
413
413
|
say_status :fly, "start #{app}"
|
414
414
|
if not toml['processes'] or toml['processes'].empty?
|
415
|
-
|
415
|
+
options[:name] = "#{app}-machine"
|
416
|
+
taken = existing_machines.find {|name| name.start_with? options[:name]}
|
417
|
+
options[:name] = taken == options[:name] ? "#{taken}-2" : taken.next if taken
|
418
|
+
|
419
|
+
start = Fly::Machines.create_and_start_machine(app, options)
|
416
420
|
machines['app'] = start[:id]
|
417
421
|
else
|
418
422
|
config[:env] ||= {}
|
419
423
|
config[:env]['NATS_SERVER'] = 'localhost'
|
420
424
|
toml['processes'].each do |name, entrypoint|
|
425
|
+
options[:name] = "#{app}-machine-#{name}"
|
426
|
+
taken = existing_machines.find {|name| name.start_with? options[:name]}
|
427
|
+
options[:name] = taken == options[:name] ? "#{taken}-2" : taken.next if taken
|
428
|
+
|
421
429
|
config[:env]['SERVER_COMMAND'] = entrypoint
|
422
|
-
start = Fly::Machines.create_and_start_machine(app,
|
430
|
+
start = Fly::Machines.create_and_start_machine(app, options)
|
423
431
|
|
424
432
|
if start['error']
|
425
|
-
STDERR.puts start
|
433
|
+
STDERR.puts "ERROR: #{start['error']}"
|
426
434
|
exit 1
|
427
435
|
end
|
428
436
|
|
@@ -499,7 +507,7 @@ module Fly
|
|
499
507
|
# perform release, if necessary
|
500
508
|
if (IO.read('lib/tasks/fly.rake') rescue '') =~ /^\s*task[ \t]*+:?release"?[ \t]*\S/
|
501
509
|
say_status :fly, config[:env]['SERVER_COMMAND']
|
502
|
-
event, exit_code, machine = release(app, config)
|
510
|
+
event, exit_code, machine = release(app, region: @region, config: config)
|
503
511
|
else
|
504
512
|
exit_code = 0
|
505
513
|
end
|
data/lib/fly.io-rails/version.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.19
|
5
5
|
platform: arm64-darwin
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fly-ruby
|