-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/test'
- Loading branch information
Showing
7 changed files
with
159 additions
and
7 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,2 +1,8 @@ | ||
# Lykke.Tools.AssetMigrator | ||
Generic tool for assets migrations | ||
|
||
**NB!** You should either cleanup migrations table before each migration session, or specify unique migration id. | ||
|
||
## Usage example | ||
|
||
dotnet migrate-asset.dll Transfer --balances-conn-string "azure-connection-string" --from 94853f34-3524-486d-923e-3275907aecb4 --to 2149a271-f94b-464a-8d23-673905f5feed --me-endpoint host:port --operations-url http://host/ --accuracy 5 --multiplier 3 --migration-id aa48914b-499a-480a-9334-900932b3dc07 |
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,15 @@ | ||
using Microsoft.Extensions.CommandLineUtils; | ||
|
||
namespace Lykke.Tools.AssetMigrator | ||
{ | ||
public interface ICommandLineArguments | ||
{ | ||
MigrationMode Mode { get; } | ||
|
||
|
||
void Configure( | ||
CommandLineApplication app); | ||
|
||
bool Validate(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/Lykke.Tools.AssetMigrator/Implementations/CommandLineArguments.cs
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,30 @@ | ||
using System; | ||
using Microsoft.Extensions.CommandLineUtils; | ||
|
||
namespace Lykke.Tools.AssetMigrator.Implementations | ||
{ | ||
public class CommandLineArguments : ICommandLineArguments | ||
{ | ||
private CommandArgument _mode; | ||
|
||
|
||
public MigrationMode Mode | ||
=> Enum.Parse<MigrationMode>(_mode.Value); | ||
|
||
|
||
public void Configure( | ||
CommandLineApplication app) | ||
{ | ||
_mode = app.Argument | ||
( | ||
"mode", | ||
"Migration mode, either 'Transfer' or 'Copy'" | ||
); | ||
} | ||
|
||
public bool Validate() | ||
{ | ||
return Enum.TryParse<MigrationMode>(_mode.Value, out _); | ||
} | ||
} | ||
} |
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,8 @@ | ||
namespace Lykke.Tools.AssetMigrator | ||
{ | ||
public enum MigrationMode | ||
{ | ||
Copy, | ||
Transfer | ||
} | ||
} |
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