HTTP server that can give an evaluation order of tasks
mix deps.getmix run --no-halt
docker build -t job_server .docker run -p 3000:3000 -d job_server:latest
Example request:
curl -X POST -H "Accept: application/json" -d @data.json http://localhost:3000/get_execution_order
Expects a JSON with the following structure:
{
"tasks": [
{
"name": "task-name",
"command": "touch file",
"requires": ["required-task-name"]
}
...
]
}Where
"name"is the task name and uniquely identifies the task."command"is a shell executable command"requires"is a list of task names representing the tasks that should be executed prior to the given task
Returns the given tasks in a correct order for evaluation.
Depending on the Accept header of the request, two types of responses are implemented - JSON and plain text.
Example JSON response
{
"tasks": [
{
"name": "task_name_1",
"command": "touch file_1",
},
{
"name": "task_name_2",
"command": "touch file_2",
}
...
]
}The plain text response is meant to be executed via bash
Example plain text response
#!/usr/bin/env bash
touch file_1
touch file_2Possible error responses
422- If the request body does not have "tasks" property
- If a required property is missing
- If there is a task requirement that does not exist in the list of tasks
400if there is a cyclic dependency between the tasks