从其中一个测试用例:
场景:应在创建标记时触发构建,而不是在删除标记时触发构建 .
Given the following generic variables are configured:
| variable | expression | expressionType | defaultValue | regexpFilter |
| object_kind | $.object_kind | JSONPath | | |
| before | $.before | JSONPath | | |
| after | $.after | JSONPath | | |
| ref | $.ref | JSONPath | | |
| git_ssh_url | $.repository.git_ssh_url | JSONPath | | |
Given filter is configured with text: $object_kind $before $after
Given filter is configured with expression: ^tag_push\s0{40}\s.{40}$
Given received post content is:
"""
{
"object_kind": "tag_push",
"before": "0000000000000000000000000000000000000000",
"after": "82b3d5ae55f7080f1e6022629cdb57bfae7cccc7",
"ref": "refs/tags/v1.0.0",
"repository":{
"git_ssh_url":"git@example.com:jsmith/example.git",
}
}
"""
Then the job is triggered
Then variables are resolved to:
| variable | value |
| object_kind | tag_push |
| before | 0000000000000000000000000000000000000000 |
| after | 82b3d5ae55f7080f1e6022629cdb57bfae7cccc7 |
| ref | refs/tags/v1.0.0 |
| git_ssh_url | git@example.com:jsmith/example.git |