Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions packages/mcl/mcl_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"codaApiToken": "<TODO for user>",
"userNames": {
"Peter": "Peter Example",
"Alexander": "Alexander Ivanov"
},
"defaultUserName": "",
"defaultParentTicket": "Example Base",
"defaultStatus": "Backlog",
"defaultPriority": "normal",
"defaultEstimate": "",
"defaultTshirtSize": "M",
"defaultMilestone": "beta",
"milestoneShortNames": {
"beta": "example: beta",
"month": "example: this month",
"v1": "example: v1"
}
}
22 changes: 16 additions & 6 deletions packages/mcl/src/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import std.logger : infof, errorf, LogLevel;

import mcl.utils.path : rootDir;
import mcl.utils.tui : bold;

import cmds = mcl.commands;

alias supportedCommands = imported!`std.traits`.AliasSeq!(
Expand All @@ -16,7 +15,8 @@ alias supportedCommands = imported!`std.traits`.AliasSeq!(
cmds.shard_matrix,
cmds.host_info,
cmds.ci,
cmds.machine_create
cmds.machine_create,
cmds.add_task,
);

int main(string[] args)
Expand All @@ -26,7 +26,14 @@ int main(string[] args)

string cmd = args[1];
LogLevel logLevel = LogLevel.info;
args.getopt("log-level", &logLevel);

// sorry for that: it breaks my custom `--kind=arg` parsing
// in add_task.d
// probably there is a better method, but at least temporarily
// commented out for our fork
// (alexander):
//
// args.getopt("log-level", &logLevel);

setLogLevel(logLevel);

Expand All @@ -42,7 +49,7 @@ int main(string[] args)
{

infof("Running %s task", cmd.bold);
command();
command(args);
infof("Execution Succesfull");
return 0;
}
Expand All @@ -65,8 +72,11 @@ int wrongUsage(string error)
{
writefln("Error: %s.", error);
writeln("Usage:\n");
static foreach (cmd; supportedCommands)
static foreach (cmd; supportedCommands) {
writefln(" mcl %s", __traits(identifier, cmd));

static if (__traits(identifier, cmd) == "add_task") {
cmds.writeAddTaskHelp();
}
}
return 1;
}
2 changes: 1 addition & 1 deletion packages/mcl/src/src/mcl/commands/ci.d
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import mcl.utils.json : toJSON;

Params params;

export void ci()
export void ci(string[] args)
{
params = parseEnv!Params;

Expand Down
4 changes: 2 additions & 2 deletions packages/mcl/src/src/mcl/commands/ci_matrix.d
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ shared static this()
params = parseEnv!Params;
}

export void ci_matrix()
export void ci_matrix(string[] args)
{
createResultDirs();
nixEvalForAllSystems().array.printTableForCacheStatus();
Expand Down Expand Up @@ -186,7 +186,7 @@ Package[] checkCacheStatus(Package[] packages)
return packages;
}

export void print_table()
export void print_table(string[] args)
{
createResultDirs();

Expand Down
2 changes: 1 addition & 1 deletion packages/mcl/src/src/mcl/commands/deploy_spec.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import mcl.utils.json : tryDeserializeFromJsonFile, writeJsonFile;

import mcl.commands.ci_matrix : flakeAttr, params, nixEvalJobs, SupportedSystem;

export void deploy_spec()
export void deploy_spec(string[] args)
{
const deploySpecFile = resultDir.buildPath("cachix-deploy-spec.json");

Expand Down
2 changes: 1 addition & 1 deletion packages/mcl/src/src/mcl/commands/get_fstab.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import mcl.utils.nix : queryStorePath, nix;
import mcl.utils.string : camelCaseToCapitalCase;
import mcl.utils.process : execute;

export void get_fstab()
export void get_fstab(string[] args)
{
const params = parseEnv!Params;
const machineStorePath = getCachixDeploymentStorePath(params);
Expand Down
2 changes: 1 addition & 1 deletion packages/mcl/src/src/mcl/commands/host_info.d
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ string[string] getProcInfo(string fileOrData, bool file = true)
return r;
}

export void host_info()
export void host_info(string[] args)
{
const params = parseEnv!Params;

Expand Down
2 changes: 1 addition & 1 deletion packages/mcl/src/src/mcl/commands/machine_create.d
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ void createMachineConfiguration()

Params params;

export void machine_create()
export void machine_create(string[] args)
{
params = parseEnv!Params;
createMachineConfiguration();
Expand Down
1 change: 1 addition & 0 deletions packages/mcl/src/src/mcl/commands/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ public import mcl.commands.shard_matrix : shard_matrix;
public import mcl.commands.ci : ci;
public import mcl.commands.host_info : host_info;
public import mcl.commands.machine_create : machine_create;
public import mcl.commands.add_task : add_task, writeAddTaskHelp;
2 changes: 1 addition & 1 deletion packages/mcl/src/src/mcl/commands/shard_matrix.d
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import mcl.utils.json : toJSON;
import mcl.utils.nix : nix;
import mcl.utils.path : createResultDirs, resultDir, rootDir;

export void shard_matrix()
export void shard_matrix(string[] args)
{
const params = parseEnv!Params;
auto matrix = generateShardMatrix();
Expand Down
Loading
Loading