-
Notifications
You must be signed in to change notification settings - Fork 4
Creating a Task Configuration
The GitHub Task Manager uses a configuration file in each repository to determine what actions to take. This file is called .githubTaskManagerConfig by default.
The contents of this file are a JSON object defining 'tasks' to be performed by the GTM agent, which can include Jenkins jobs, TeamCity builds, Docker commands, Ping tests, and other tasks defined by the user in an 'Executor'.
An example configuration file is shown below. Note that tasks can themselves also contain an array of tasks, which will be executed before the main task is performed.
{
"pull_request": {
"tasks": [
{
"executor": "Jenkins",
"context": "functional",
"options": {
"tags": [
"@sample_tag"
]
},
"tasks": [
{
"executor": "Jenkins",
"context": "deploy",
"options": {
"environment": "development",
"artifact": "develop"
}
}
]
},
{
"executor": "Jenkins",
"context": "unit"
}
]
}
}
In this configuration file, we can see three tasks. The first task, a Jenkins build of the pre-defined 'functional' tests and with a set of tags passed as an option, also has a child object of 'tasks' which contains other tasks to execute beforehand, in this case, a deploy into the development environment. The second task, a set of unit tests, would be run in parallel to the chain of tasks in the first task.
Child tasks can nest tasks infinitely, allowing for build chains to be created if desired.