diff --git a/packages/mcl/src/src/mcl/commands/ci_matrix.d b/packages/mcl/src/src/mcl/commands/ci_matrix.d index e02c329f..764636ad 100755 --- a/packages/mcl/src/src/mcl/commands/ci_matrix.d +++ b/packages/mcl/src/src/mcl/commands/ci_matrix.d @@ -368,7 +368,7 @@ Package[] nixEvalJobs(string flakeAttrPrefix, string cachixUrl, bool doCheck = t })(false); const stderrLogs = pipes.stderr.byLine - .filter!(line => !uselessWarnings.canFind(line)) + .filter!(line => !uselessWarnings.any!(w => line.canFind(w))) .join("\n"); logWarning(stderrLogs); diff --git a/packages/mcl/src/src/mcl/commands/deploy_spec.d b/packages/mcl/src/src/mcl/commands/deploy_spec.d index 19b67ad1..1dba3f26 100644 --- a/packages/mcl/src/src/mcl/commands/deploy_spec.d +++ b/packages/mcl/src/src/mcl/commands/deploy_spec.d @@ -20,6 +20,8 @@ export void deploy_spec() { const deploySpecFile = resultDir.buildPath("cachix-deploy-spec.json"); + DeploySpec spec; + if (!exists(deploySpecFile)) { auto nixosConfigs = flakeAttr("legacyPackages", SupportedSystem.x86_64_linux, "bareMetalMachines") @@ -39,19 +41,21 @@ export void deploy_spec() if (!configsMissingFromCachix.empty) throw new Exception("Some Nixos configurations are not in cachix. Please cache them first."); - auto spec = nixosConfigs.createMachineDeploySpec().toJSON; - - infof("Deploy spec: %s", spec.toPrettyString(JSONOptions.doNotEscapeSlashes)); - - writeFile(deploySpecFile, spec.toString()); + spec = nixosConfigs.createMachineDeploySpec(); + writeFile(deploySpecFile, spec.toJSON.toPrettyString(JSONOptions.doNotEscapeSlashes)); } else { warningf("Reusing existing deploy spec at:\n'%s'", deploySpecFile.bold); - - warningf("\n---\n%s\n---", deploySpecFile.tryDeserializeFromJsonFile!DeploySpec); + spec = deploySpecFile.tryDeserializeFromJsonFile!DeploySpec; } + infof("\n---\n%s\n---", spec); + infof("%s machines will be deployed.", spec.agents.length); + + if (!spec.agents.length) + return; + spawnProcessInline([ "cachix", "deploy", "activate", deploySpecFile, "--async" ]); diff --git a/packages/mcl/src/src/mcl/utils/json.d b/packages/mcl/src/src/mcl/utils/json.d index c60b2c54..602204ba 100644 --- a/packages/mcl/src/src/mcl/utils/json.d +++ b/packages/mcl/src/src/mcl/utils/json.d @@ -328,5 +328,5 @@ T tryDeserializeFromJsonFile(T)(string path) return json .fromJSON!T() - .tryGet("Error deserializing %s. JSON: %s".format(T.stringof.bold, json.toPrettyString().bold)); + .tryGet("Error deserializing %s. JSON: \n%s".format(T.stringof.bold, json.toPrettyString().bold)); }