-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Plebeian-Technology/sway in…
…to padawan
- Loading branch information
Showing
16 changed files
with
214 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v20.12.2 | ||
20.12.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# fly.toml app configuration file generated for sway on 2024-06-07T10:24:01-04:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = 'sway' | ||
primary_region = 'mia' | ||
console_command = '/rails/bin/rails console' | ||
|
||
[build] | ||
image = 'ghcr.io/plebeian-technology/sway:latest' | ||
#dockerfile = "docker/dockerfiles/production.dockerfile" | ||
#ignorefile = "docker/dockerfiles/production.dockerfile.dockerignore" | ||
|
||
[[mounts]] | ||
source = 'prodswaysqlite' | ||
destination = '/storage' | ||
|
||
[http_service] | ||
internal_port = 3000 | ||
force_https = true | ||
auto_stop_machines = true | ||
auto_start_machines = true | ||
min_machines_running = 1 | ||
max_machines_running = 3 | ||
|
||
[http_service.concurrency] | ||
type = "requests" | ||
soft_limit = 200 | ||
hard_limit = 250 | ||
|
||
[[http_service.checks]] | ||
interval = '30s' | ||
timeout = '5s' | ||
grace_period = '10s' | ||
method = 'GET' | ||
path = '/up' | ||
|
||
[checks] | ||
[checks.status] | ||
port = 3000 | ||
type = 'http' | ||
interval = '10s' | ||
timeout = '2s' | ||
grace_period = '5s' | ||
method = 'GET' | ||
path = '/up' | ||
protocol = 'http' | ||
tls_skip_verify = false | ||
|
||
[checks.status.headers] | ||
X-Forwarded-Proto = 'https' | ||
|
||
[[vm]] | ||
#memory = '256mb' | ||
memory = '1gb' | ||
cpu_kind = 'shared' | ||
cpus = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# https://fly.io/docs/rails/advanced-guides/sqlite3/ | ||
|
||
# commands used to deploy a Rails application | ||
namespace :fly do | ||
# BUILD step: | ||
# - changes to the filesystem made here DO get deployed | ||
# - NO access to secrets, volumes, databases | ||
# - Failures here prevent deployment | ||
task build: 'assets:precompile' | ||
|
||
# RELEASE step: | ||
# - changes to the filesystem made here are DISCARDED | ||
# - full access to secrets, databases | ||
# - failures here prevent deployment | ||
task :release | ||
|
||
# SERVER step: | ||
# - changes to the filesystem made here are deployed | ||
# - full access to secrets, databases | ||
# - failures here result in VM being stated, shutdown, and rolled back | ||
# to last successful deploy (if any). | ||
task server: 'db:migrate' do | ||
sh 'bin/rails server' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require_relative '../sway_google_cloud_storage' | ||
|
||
namespace :sway do | ||
include SwayGoogleCloudStorage | ||
|
||
desc 'Sets up a remote volume with files downloaded from a Google Cloud bucket' | ||
task volume_setup: :environment do | ||
download_directory(bucket_name: 'sway-sqlite', bucket_directory_name: 'seeds', local_directory_name: 'storage') | ||
download_directory(bucket_name: 'sway-sqlite', bucket_directory_name: 'geojson', local_directory_name: 'storage') | ||
|
||
if File.exist? 'storage/production.sqlite3' | ||
puts 'Uploading production.db to google storage as backup.' | ||
upload_file(bucket_name: 'sway-sqlite', bucket_file_path: 'production.sqlite3', | ||
local_file_path: 'storage/production.sqlite3') | ||
else | ||
puts 'Getting production.db from google storage backup.' | ||
download_file(bucket_name: 'sway-sqlite', bucket_file_path: 'production.sqlite3', | ||
local_file_path: 'storage/production.sqlite3') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.