Trying deploy replication
This commit is contained in:
parent
ffe762f860
commit
8fb63213bc
@ -68,6 +68,9 @@ namespace CodexNetDeployer
|
||||
[Uniform("check-connect", "cc", "CHECKCONNECT", false, "If true, deployer check ensure peer-connectivity between all deployed nodes after deployment. Default is false.")]
|
||||
public bool CheckPeerConnection { get; set; } = false;
|
||||
|
||||
[Uniform("replication", "rep", "REPLICATION", false, "Number of times to repeat")]
|
||||
public int Replication { get; set; } = 0;
|
||||
|
||||
public List<string> Validate()
|
||||
{
|
||||
var errors = new List<string>();
|
||||
|
@ -33,13 +33,31 @@ public class Program
|
||||
Console.WriteLine("I think so too.");
|
||||
}
|
||||
|
||||
var deployment = deployer.Deploy();
|
||||
if (config.Replication == 0)
|
||||
{
|
||||
var deployment = deployer.Deploy();
|
||||
|
||||
Console.WriteLine($"Writing deployment file '{config.DeployFile}'...");
|
||||
Console.WriteLine($"Writing deployment file '{config.DeployFile}'...");
|
||||
File.WriteAllText(config.DeployFile, JsonConvert.SerializeObject(deployment, Formatting.Indented));
|
||||
Console.WriteLine("Done!");
|
||||
}
|
||||
else
|
||||
{
|
||||
var originalNamespace = config.KubeNamespace;
|
||||
var originalDeployFile = config.DeployFile;
|
||||
for (var i = 0; i < config.Replication; i++)
|
||||
{
|
||||
config.KubeNamespace = originalNamespace + "-" + i;
|
||||
config.DeployFile = originalDeployFile.ToLowerInvariant().Replace(".json", $"-{i}.json");
|
||||
|
||||
File.WriteAllText(config.DeployFile, JsonConvert.SerializeObject(deployment, Formatting.Indented));
|
||||
var deployment = deployer.Deploy();
|
||||
|
||||
Console.WriteLine("Done!");
|
||||
Console.WriteLine($"Writing deployment file '{config.DeployFile}'...");
|
||||
File.WriteAllText(config.DeployFile, JsonConvert.SerializeObject(deployment, Formatting.Indented));
|
||||
}
|
||||
|
||||
Console.WriteLine("Done!");
|
||||
}
|
||||
}
|
||||
|
||||
private static void PrintHelp()
|
||||
|
Loading…
x
Reference in New Issue
Block a user