fly.io-rails 0.1.16-aarch64-linux → 0.1.17-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 +22 -7
- data/lib/fly.io-rails/version.rb +1 -1
- 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: 9b811abd0796f98b64ce088f8e9b2b4cd31308e739a1f11066c78ee4ef203c7c
|
4
|
+
data.tar.gz: efc0ff0a0ce55759bf6ba1a0d2da3438e7fd85a5ca8216d82a69ff9e18c35833
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b2dcdab7c02f669cdb5f0583d41c0110129ce319121baab165621908f88d2c8436fff613469b5e0ca44281730e47945e5aef7bfabddd13f3e4aae0227e4841b
|
7
|
+
data.tar.gz: 95876661bc40e5ae17233cd425bebf458e83f12de769bfd2233c4e3e44da629bfbd55752c8017710897a1e8c2f2dffc4e21031aa8f55212d05434f11fb67556f
|
data/lib/fly.io-rails/actions.rb
CHANGED
@@ -197,17 +197,19 @@ module Fly
|
|
197
197
|
end
|
198
198
|
|
199
199
|
def create_volume(app, region, size)
|
200
|
-
|
201
|
-
volumes = JSON.parse(`flyctl volumes list --json`)
|
202
|
-
map {|volume| [volume['Name'], volume['Region']]}
|
200
|
+
name = "#{app.gsub('-', '_')}_volume"
|
201
|
+
volumes = JSON.parse(`flyctl volumes list --json`)
|
203
202
|
|
204
|
-
|
205
|
-
|
203
|
+
volume = volumes.find {|volume| volume['Name'] == name and volume['Region'] == region}
|
204
|
+
unless volume
|
205
|
+
cmd = "flyctl volumes create #{name} --app #{app} --region #{region} --size #{size}"
|
206
206
|
say_status :run, cmd
|
207
207
|
system cmd
|
208
|
+
volumes = JSON.parse(`flyctl volumes list --json`)
|
209
|
+
volume = volumes.find {|volume| volume['Name'] == name and volume['Region'] == region}
|
208
210
|
end
|
209
211
|
|
210
|
-
volume
|
212
|
+
volume && volume['id']
|
211
213
|
end
|
212
214
|
|
213
215
|
def create_postgres(app, org, region, vm_size, volume_size, cluster_size)
|
@@ -396,7 +398,14 @@ module Fly
|
|
396
398
|
config[:services] = toml['services'] if toml['services']
|
397
399
|
if toml['mounts']
|
398
400
|
mounts = toml['mounts']
|
399
|
-
|
401
|
+
volume = JSON.parse(`flyctl volumes list --json`).
|
402
|
+
find {|volume| volume['Name'] == mounts['source'] and volume['Region'] == @region}
|
403
|
+
if volume
|
404
|
+
config[:mounts] = [ { volume: volume['id'], path: mounts['destination'] } ]
|
405
|
+
else
|
406
|
+
STDERR.puts "volume #{mounts['source']} not found in region #{@region}"
|
407
|
+
exit 1
|
408
|
+
end
|
400
409
|
end
|
401
410
|
|
402
411
|
# start app
|
@@ -411,6 +420,12 @@ module Fly
|
|
411
420
|
toml['processes'].each do |name, entrypoint|
|
412
421
|
config[:env]['SERVER_COMMAND'] = entrypoint
|
413
422
|
start = Fly::Machines.create_and_start_machine(app, config: config)
|
423
|
+
|
424
|
+
if start['error']
|
425
|
+
STDERR.puts start.inspect
|
426
|
+
exit 1
|
427
|
+
end
|
428
|
+
|
414
429
|
machines[name] = start[:id]
|
415
430
|
|
416
431
|
config.delete :mounts
|
data/lib/fly.io-rails/version.rb
CHANGED