-
Notifications
You must be signed in to change notification settings - Fork 237
WIP: Fly commands
Keith Schacht edited this page May 28, 2024
·
3 revisions
- https://fly.io/ruby-dispatch/run-ordinary-rails-apps-globally
- https://github.com/superfly/fly-ruby
- https://fly.io/blog/last-mile-redis
- https://edgeguides.rubyonrails.org/active_record_multiple_databases.html#setting-up-your-application
- https://fly.io/docs/reference/regions/
fly machines list -a the-bot-db
Get the ID of a replica machine: https://fly.io/apps/the-bot-db/monitoring
fly machine clone --region atl ##### -a the-bot-db
fly machine stop -a the-bot-db ##### fly machine destroy -a the-bot-db #####
Find volume: https://fly.io/apps/the-bot-db/volumes fly volumes destroy -a the-bot-db #####
fly m update e82423eb073078 --vm-memory 256 -a the-bot-db
class Fly < SDK
def key
raise "self.key is undefined. You need to override this method."
end
def bearer_token
`fly auth token`.chop
end
def get(url)
SDK::Get.new(url, ->{ key }, ->{ bearer_token })
end
def post(url)
SDK::Post.new(url, ->{ key }, ->{ bearer_token })
end
def patch(url)
post(url)
end
end
reload!; fly = Fly.new; config = fly.get("https://api.machines.dev/v1/apps/the-bot-db/machines/e82423eb073078").no_params.config
config.init.swap_size_mb = 512
new_config = fly.post("https://api.machines.dev/v1/apps/the-bot-db/machines/e82423eb073078").params({ config: config }).config