Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

More missing zuul schema properties #6

Merged
merged 1 commit into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions examples/zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
files: 'pattern' # or list of patterns
override-checkout: master
success-url: docs/
tags: all-platforms
required-projects:
- foo
- bar

- project-template:
name: sample-template
Expand All @@ -60,9 +64,13 @@
- sample-template
vars:
var_for_all_jobs: value
# common pipeline names (sadly at same level as properties)
check:
jobs:
- job1
- job2:
vars:
var_for_all_jobs: override
gate: {}
promote: {}
periodic-weekly: {}
33 changes: 33 additions & 0 deletions f/zuul.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@
],
"title": "Pre-Run"
},
"required-projects": {
"items": {
"type": "string"
},
"title": "Required-Projects",
"type": "array"
},
"run": {
"title": "Run",
"type": "string"
Expand All @@ -132,6 +139,20 @@
"title": "Success-Url",
"type": "string"
},
"tags": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
],
"title": "Tags"
},
"timeout": {
"title": "Timeout",
"type": "integer"
Expand Down Expand Up @@ -194,9 +215,15 @@
"title": "Name",
"type": "string"
},
"periodic-weekly": {
"$ref": "#/definitions/PipelineModel"
},
"post": {
"$ref": "#/definitions/PipelineModel"
},
"promote": {
"$ref": "#/definitions/PipelineModel"
},
"release": {
"$ref": "#/definitions/PipelineModel"
},
Expand Down Expand Up @@ -245,9 +272,15 @@
"title": "Name",
"type": "string"
},
"periodic-weekly": {
"$ref": "#/definitions/PipelineModel"
},
"post": {
"$ref": "#/definitions/PipelineModel"
},
"promote": {
"$ref": "#/definitions/PipelineModel"
},
"release": {
"$ref": "#/definitions/PipelineModel"
},
Expand Down
4 changes: 4 additions & 0 deletions src/ansibleschemas/zuul.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class ProjectBaseModel(BaseModel):
release: Optional[PipelineModel]
check: Optional[PipelineModel]
gate: Optional[PipelineModel]
promote: Optional[PipelineModel]
periodic_weekly: Optional[PipelineModel] = Field(alias="periodic-weekly")


class ProjectTemplateModel(ProjectBaseModel):
Expand Down Expand Up @@ -66,6 +68,8 @@ class JobModel(BaseModel):
Union[float, Literal["2.7", "2.8", "2.9", "2.10", "2.11"]]
] = Field(alias="ansible-version")
host_vars: Optional[Mapping[str, Mapping[str, Any]]] = Field(alias="host-vars")
tags: Optional[Union[str, List[str]]]
required_projects: Optional[List[str]] = Field(alias="required-projects")

class Config:
extra = Extra.forbid
Expand Down