X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7a24a37aa9e5ed425550403b68c270316a24d772..10bfcf75847ada2dee77a276b4cc912b43acc936:/lib/boot/seed.go diff --git a/lib/boot/seed.go b/lib/boot/seed.go index f915764c58..bd1e942658 100644 --- a/lib/boot/seed.go +++ b/lib/boot/seed.go @@ -8,18 +8,26 @@ import ( "context" ) +// Populate a blank database with arvados tables and seed rows. type seedDatabase struct{} func (seedDatabase) String() string { return "seedDatabase" } -func (seedDatabase) Run(ctx context.Context, fail func(error), boot *Booter) error { - err := boot.wait(ctx, runPostgreSQL{}) +func (seedDatabase) Run(ctx context.Context, fail func(error), super *Supervisor) error { + err := super.wait(ctx, runPostgreSQL{}, installPassenger{src: "services/api"}) if err != nil { return err } - err = boot.RunProgram(ctx, "services/api", nil, nil, "bundle", "exec", "rake", "db:setup") + if super.ClusterType == "production" { + return nil + } + err = super.RunProgram(ctx, "services/api", runOptions{env: railsEnv}, "bundle", "exec", "rake", "db:setup") + if err != nil { + return err + } + err = super.RunProgram(ctx, "services/api", runOptions{env: railsEnv}, "bundle", "exec", "./script/get_anonymous_user_token.rb") if err != nil { return err }