-
Notifications
You must be signed in to change notification settings - Fork 4
Structure of .githubTaskManager.json
AV edited this page Mar 13, 2018
·
6 revisions
The .githubTaskManager.json file is used to control the automation that is executed in response to a given github event.
Each eventType targetted is a top level member of the json file, and must map to a supported github eventType.
- agentGroup : String(optional) used to target a group of agents to handle events for this repo/event type.
- tasks : Array of task definitions to be executed. This array is run in parallel.
{
"pull_request": {
"agentGroup": "GTM",
"tasks": [
<array of task objects>
]
}
}
- executor : String name of a supported executor. eg. 'Jenkins' or 'Docker'
- context : String short unique description of task.
- options : Object containing config passed to executor function. The structure of the options is executor specific. (see below)
- disabled : Boolean(optional) disable this task and its subtasks temporarily?
- tasks : Array(optional) of subtasks to be executed in parallel when parent task is completed. Same structure as parent.
Here are the supported 'options' for each executor currently supported.
- jobName : String name of Jenkins job to execute in configured Jenkins environment.
- parameters : Object containing key:value pairs to be passed to Jenkins job. Note that templated parameters are available in form @##KEY### (TODO supported keys).
{
"executor": "Jenkins",
"context": "run e2e tests",
"options": {
"jobName": "EXECUTE_AUTOMATED_TESTS",
"parameters": {
"TAGS": "['@project-tag', '@##GHREPONAME']",
"ENVIRONMENT": "test1"
}
}
}
- image : String name of image to pull from registry and run. eg. 'alpine:latest'
- command : Array of Strings making up command to execute in container.
- env: Dictionary object to be passed to container as environment variables. Token replacement supported.
{
"executor": "Docker",
"context": "run ls in latest alpine",
"options": {
"image": "alpine:latest",
"command": "/bin/ls -ltra /bin/ls"
"env": {
"MYVAR": "MYVAL",
"MYVAR2": "MYVAL2"
}
}
}
This is a subclass of the Docker executor. Please ensure that relevant GTM_SONAR_* environment vars are configured for agents.
Pass in BUILD_TYPE as one of: maven, gradle, nodejs. The remaining options are defined in the executor and are context sensitive. You can override any options here.
{
"executor": "DockerSonar",
"context": "Scan PR",
"options": {
"env": {
"BUILD_TYPE": "nodejs"
}
}
}
Requires a LaunchDarkly (https://launchdarkly.com) account, and env var LAUNCHDARKLY_API_TOKEN configured for agents.
- project : The LaunchDarkly project name.
- environment : The LaunchDarkly environment name.
- flags : The LaunchDarkly flags to toggle on/off in given environment. (true=on, false=off)
{
"executor": "LaunchDarkly",
"context": "Set FeatureFlags",
"options": {
"project": "myProject",
"environment": "dev",
"flags": {
"testFlagOne": true,
"testFlagTwo": false
}
}
}
- jobName : String name of Jenkins job to execute in configured Jenkins environment.
- parameters : Object containing key:value pairs to be passed to Jenkins job.
{
"executor": "TeamCity",
"context": "run e2e tests",
"options": {
"jobName": "EXECUTE_AUTOMATED_TESTS",
"parameters": {
"TAGS": "['@project-tag', '@##GHREPONAME']",
"ENVIRONMENT": "test1"
}
}
}
- har : object in HAR format describing request to make. Refer to http://www.softwareishard.com/blog/har-12-spec/#request
-
validator : Object(optional) type of validator used to check the response object and determine pass/fail. Currently only supports
validator.type="bodyJson"
.
{
"executor": "Http",
"context": "check response host header"
"options": {
"har": {
"url": "http://expected.hostname.com.au",
"method": "GET",
"headers": [
{
"name": "accept",
"value": application/json"
}
]
},
"validator": {
"type": "bodyJson",
"objectCheckRef": "headers.Host",
"objectCheckRef": "expected.hostname.com.au"
}
}
}