Skip to content

Commit

Permalink
Merge pull request #540 from Scalingo/fix/539/region-name-migration
Browse files Browse the repository at this point in the history
Display region name in migration example commands
  • Loading branch information
john-scalingo authored Mar 30, 2020
2 parents 444ce30 + fc81a28 commit 7c31734
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 41 deletions.
6 changes: 3 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion addons/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package addons
import (
"github.com/Scalingo/cli/config"
"github.com/Scalingo/cli/io"
scalingo "github.com/Scalingo/go-scalingo"
"github.com/Scalingo/go-scalingo"
"gopkg.in/errgo.v1"
)

Expand Down
29 changes: 0 additions & 29 deletions cmd/autocomplete/notifications.go

This file was deleted.

2 changes: 1 addition & 1 deletion region_migrations/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func Run(app, migrationID string, step scalingo.RegionMigrationStep) error {
if !shouldContinue {
fmt.Println("The current step has been canceled. You can restart it later.")
fmt.Println("If you want to abort the migration, run:")
fmt.Printf("scalingo --app %s migration-abort %s\n", app, migrationID)
fmt.Printf("scalingo --region %s --app %s migration-abort %s\n", migration.Source, app, migrationID)
return nil
}
expectedStatuses := []scalingo.RegionMigrationStatus{}
Expand Down
12 changes: 6 additions & 6 deletions region_migrations/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func showMigrationStatusFailed(appId string, migration scalingo.RegionMigration,

if opts.CurrentStep != scalingo.RegionMigrationStepAbort && migration.Status != scalingo.RegionMigrationStatusPreflightError {
fmt.Println("To rollback your application to a working state, run:")
fmt.Printf("scalingo --app %s migration-abort %s\n\n", appId, migration.ID)
fmt.Printf("scalingo --region %s --app %s migration-abort %s\n\n", migration.Source, appId, migration.ID)
}

fmt.Println("You can contact [email protected] to troubleshoot this issue.")
Expand All @@ -103,27 +103,27 @@ func showMigrationStatusFailed(appId string, migration scalingo.RegionMigration,
func showMigrationStatusPreflightSuccess(appId string, migration scalingo.RegionMigration) {
fmt.Printf("Your app can be migrated to the %s zone.\n", migration.Destination)
fmt.Printf("To start the migration launch:\n\n")
fmt.Printf("scalingo --app %s migration-run --prepare %s\n", appId, migration.ID)
fmt.Printf("scalingo --region %s --app %s migration-run --prepare %s\n", migration.Source, appId, migration.ID)
}

func showMigrationStatusPrepared(appId string, migration scalingo.RegionMigration) {
fmt.Printf("Application on region '%s' has been prepared, you can now:\n", migration.Destination)
fmt.Printf("- Let us migrate your data to '%s' newly created databases with:\n", migration.Destination)
fmt.Printf("scalingo --app %s migration-run --data %s\n", appId, migration.ID)
fmt.Printf("scalingo --region %s --app %s migration-run --data %s\n", migration.Source, appId, migration.ID)
fmt.Printf("- Handle data migration manually, then finalizing the migration with:\n")
fmt.Printf("scalingo --app %s migration-run --finalize %s\n", appId, migration.ID)
fmt.Printf("scalingo --region %s --app %s migration-run --finalize %s\n", migration.Source, appId, migration.ID)
}

func showMigrationStatusDataMigrated(appId string, migration scalingo.RegionMigration) {
fmt.Printf("Data has been migrated to the '%s' region\n", migration.Destination)
fmt.Printf("You can finalize the migration with:\n")
fmt.Printf("scalingo --app %s migration-run --finalize %s\n", appId, migration.ID)
fmt.Printf("scalingo --region %s --app %s migration-run --finalize %s\n", migration.Source, appId, migration.ID)
}

func showMigrationStatusAborted(appId string, migration scalingo.RegionMigration) {
fmt.Printf("The migration '%s' has been aborted\n", migration.ID)
fmt.Printf("You can retry it with:\n")
fmt.Printf("scalingo --app %s migration-create --to %s", appId, migration.Destination)
fmt.Printf("scalingo --region %s --app %s migration-create --to %s", migration.Source, appId, migration.Destination)
if migration.DstAppName != migration.SrcAppName {
fmt.Printf(" --new-name %s \n", migration.DstAppName)
} else {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/Scalingo/go-scalingo/version.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7c31734

Please sign in to comment.