How to run windows cmd command using nomad Job?
You can use the Raw exec driver on Windows for this purpose:
task "webservice" {
driver = "raw_exec"
config {
command = "my-binary"
args = ["-flag", "1"]
}
}
Raw exec disabled by default you will need to enable it in your configuration for the clients
client {
enabled = true
network_speed = 10
options {
"driver.raw_exec.enable" = "1"
}
}
1 Like
Minor nitpick, the syntax shown to enable raw_exec
is for v0.8.x and below, the syntax for v0.9.x and above is different.
Even though this syntax will work for now, it would get deprecated soon, so better to use the newer syntax.