I try to call node file.js using the Bluemix workload scheduler every morning; file.js is at the root of my node.js project; file.js is not my server file. I used to use cron, but it seems to me that "BlueMix has no idea about cron working."
As a result for the (single) step of my process, I got "node: command not found"
I think I missed something. Is it possible to do this with a workload scheduler or should I find alternatives?
ADDITIONAL INFORMATION
I am trying to do:
var wls = new WorkloadService(credentials); var wp = new WAProcess("MyProcessName", "DescriptionProcess"); wp.addStep(new CommandStep("node file.js", myAgentName)); wp.addTrigger( TriggerFactory.repeatDaily(1) ); wls.createAndEnableTask(wp, function(res){ wls.runTask(res.id, function(){console.log("Process is created and started.")}); });
In the "IBM Workload Automation on Cloud - Application Lab", I see that the process is created and running. A little later, the process failed, saying: "node command not found"
I think I read in the documentation that an agent can only call local system commands (e.g. cat, pwd ...) or commands that interact with an external one (to call REST services). Thus, he cannot find the command node command or file.js.
If I do not install everything on the agent? The documentation says that we can install programs in the /home/wauser/workspace directory using the curl command. So should I go on?
source share