makes output deployment json configurable.

This commit is contained in:
benbierens 2023-10-05 08:46:59 +02:00
parent 9cb8c57615
commit ffe762f860
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
3 changed files with 6 additions and 2 deletions

View File

@ -14,6 +14,9 @@ namespace CodexNetDeployer
[Uniform("kube-namespace", "kn", "KUBENAMESPACE", true, "Kubernetes namespace to be used for deployment.")]
public string KubeNamespace { get; set; } = string.Empty;
[Uniform("deploy-file", "df", "DEPLOYFILE", false, "Output deployment JSON file that will be written. Defaults to 'codex-deployment.json'.")]
public string DeployFile { get; set; } = "codex-deployment.json";
[Uniform("codex-local-repo", "cr", "CODEXLOCALREPOPATH", false, "If set, instead of using the default Codex docker image, the local repository will be used to build an image. " +
"This requires the 'DOCKERUSERNAME' and 'DOCKERPASSWORD' environment variables to be set. (You can omit the password to use your system default, or use a docker access token as DOCKERPASSWORD.) You can set " +
"'DOCKERTAG' to define the image tag. If not set, one will be generated.")]

View File

@ -35,9 +35,9 @@ public class Program
var deployment = deployer.Deploy();
Console.WriteLine("Writing codex-deployment.json...");
Console.WriteLine($"Writing deployment file '{config.DeployFile}'...");
File.WriteAllText("codex-deployment.json", JsonConvert.SerializeObject(deployment, Formatting.Indented));
File.WriteAllText(config.DeployFile, JsonConvert.SerializeObject(deployment, Formatting.Indented));
Console.WriteLine("Done!");
}

View File

@ -1,6 +1,7 @@
dotnet run \
--kube-config=/opt/kubeconfig.yaml \
--kube-namespace=codex-continuous-tests \
--deploy-file=codex-deployment.json \
--nodes=5 \
--validators=3 \
--log-level=Trace \