Skip to content

Commit

Permalink
Merge f6eed81 into 26a778e
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys authored Jan 5, 2025
2 parents 26a778e + f6eed81 commit c826931
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scanner/rails.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,15 @@ func configureRails(sourceDir string, config *ScannerConfig) (*SourceInfo, error
// postgresql
s.DatabaseDesired = DatabaseKindPostgres
s.SkipDatabase = false
} else {
} else if checksPass(sourceDir, dirContains("Dockerfile", "sqlite3")) {
// sqlite
s.DatabaseDesired = DatabaseKindSqlite
s.SkipDatabase = true
s.ObjectStorageDesired = true
} else {
// no database
s.DatabaseDesired = DatabaseKindNone
s.SkipDatabase = true
}

// enable redis if there are any action cable / anycable channels
Expand Down Expand Up @@ -425,6 +430,11 @@ func RailsCallback(appName string, srcInfo *SourceInfo, plan *plan.LaunchPlan, f
// add object storage
if plan.ObjectStorage.Provider() != nil {
args = append(args, "--tigris")

// add litestream if object storage is available and the database is sqlite
if srcInfo.DatabaseDesired == DatabaseKindSqlite {
args = append(args, "--litestream")
}
}

// add additional flags from launch command
Expand Down

0 comments on commit c826931

Please sign in to comment.