fly.io-rails 0.1.17 → 0.1.18

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: 6cd9eeec82563db7cad109945cd690f9da1b0d064a9505b196df8e3735120484
4
- data.tar.gz: ed54c0bc5884f9793913ac7430e865a84c85175aca383d02c8999acb0c0ba5b2
3
+ metadata.gz: 62e1e45b67b1e59c9d6bf778c523af71a59a04ebdf7946d009ea8593424f931f
4
+ data.tar.gz: 1635153348c6abd68625f3617880a528bd9a4e7b5856efe5b861a1f9231d83d4
5
5
  SHA512:
6
- metadata.gz: da01a522eab3c5c28febc36e304919de75108947052bd12fdbc697bc5684b0b2fe29eb3c0332332da7959b8c3ade087190f4e090ca4cb659d263bb5c1532e3f8
7
- data.tar.gz: d74d360f004f7dd42ed54b025d245fba96c37faddaf48eeb0edb4fd27bb8b23f2a2af3ea896a5d01a6f518043e992c766b353248de966c86b5eec434432fa3d6
6
+ metadata.gz: 2c910a4ae830a27db4041023be42c5c80a0cb1dc05a5e25411c6578a62ad199a0e7d139fe145695f197f2f68c80e19eac131e837e5fc398a2a64f7126afa93b4
7
+ data.tar.gz: 94cb87aa38e1a73a6cb9eecd0e9b009e10de12800e3667695881eac524d89408ef173c2065825b5ceb31e14c38b8b556a0b6b93cd53cb508cabfb52c1e7ac16c
@@ -237,8 +237,8 @@ module Fly
237
237
  output[%r{redis://\S+}]
238
238
  end
239
239
 
240
- def release(app, config)
241
- start = Fly::Machines.create_and_start_machine(app, config: config)
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'
@@ -410,19 +407,22 @@ module Fly
410
407
 
411
408
  # start app
412
409
  machines = {}
410
+ options = {region: @region, config: config}
413
411
  say_status :fly, "start #{app}"
414
412
  if not toml['processes'] or toml['processes'].empty?
415
- start = Fly::Machines.create_and_start_machine(app, config: config)
413
+ options[:name] = "#{app}-machine",
414
+ start = Fly::Machines.create_and_start_machine(app, options)
416
415
  machines['app'] = start[:id]
417
416
  else
418
417
  config[:env] ||= {}
419
418
  config[:env]['NATS_SERVER'] = 'localhost'
420
419
  toml['processes'].each do |name, entrypoint|
420
+ options[:name] = "#{app}-machine-#{name}"
421
421
  config[:env]['SERVER_COMMAND'] = entrypoint
422
- start = Fly::Machines.create_and_start_machine(app, config: config)
422
+ start = Fly::Machines.create_and_start_machine(app, options)
423
423
 
424
424
  if start['error']
425
- STDERR.puts start.inspect
425
+ STDERR.puts "ERROR: #{start.error}"
426
426
  exit 1
427
427
  end
428
428
 
@@ -499,7 +499,7 @@ module Fly
499
499
  # perform release, if necessary
500
500
  if (IO.read('lib/tasks/fly.rake') rescue '') =~ /^\s*task[ \t]*+:?release"?[ \t]*\S/
501
501
  say_status :fly, config[:env]['SERVER_COMMAND']
502
- event, exit_code, machine = release(app, config)
502
+ event, exit_code, machine = release(app, region: @region, config: config)
503
503
  else
504
504
  exit_code = 0
505
505
  end
@@ -1,3 +1,3 @@
1
1
  module Fly_io
2
- VERSION = '0.1.17'
2
+ VERSION = '0.1.18'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fly.io-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby