Skip to content

Commit

Permalink
pipeline jsonschema
Browse files Browse the repository at this point in the history
added a schema definition for pipeline.yaml files
no validation has been added yet. the mgmt-pipeline.yaml has been adapted to this schema.

Signed-off-by: Gerd Oberlechner <[email protected]>
  • Loading branch information
geoberle committed Dec 5, 2024
1 parent 1664893 commit a8da435
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 11 deletions.
193 changes: 193 additions & 0 deletions config/pipeline.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Pipeline Configuration Schema",
"type": "object",
"definitions": {
"variable": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"input": {
"type": "object",
"additionalProperties": false,
"properties": {
"step": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"step",
"name"
]
},
"configRef": {
"type": "string"
}
},
"oneOf": [
{
"required": [
"name",
"input"
]
},
{
"required": [
"name",
"configRef"
]
}
],
"required": [
"name"
]
}
},
"properties": {
"serviceGroup": {
"type": "string"
},
"rolloutName": {
"type": "string"
},
"resourceGroups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"subscription": {
"type": "string"
},
"steps": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"action": {
"type": "string",
"enum": ["ARM", "Shell"]
},
"template": {
"type": "string"
},
"parameters": {
"type": "string"
},
"command": {
"type": "string"
},
"variables": {
"type": "array",
"items": {
"$ref": "#/definitions/variable"
}
},
"dependsOn": {
"type": "array",
"items": {
"type": "string"
}
}
},
"oneOf": [
{
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"action": {
"type": "string",
"enum": ["ARM"]
},
"template": {
"type": "string"
},
"parameters": {
"type": "string"
},
"variables": {
"type": "array",
"items": {
"$ref": "#/definitions/variable"
}
},
"dependsOn": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"template",
"parameters"
]
},
{
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"action": {
"type": "string",
"enum": ["Shell"]
},
"command": {
"type": "string"
},
"variables": {
"type": "array",
"items": {
"$ref": "#/definitions/variable"
}
},
"dependsOn": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"command"
]
}
],
"required": [
"name",
"action"
]
}
},
"aksCluster": {
"type": "string"
}
},
"required": [
"name",
"subscription",
"steps"
]
}
}
},
"required": [
"serviceGroup",
"rolloutName",
"resourceGroups"
]
}
15 changes: 9 additions & 6 deletions dev-infrastructure/mgmt-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
serviceGroup: Microsoft.Azure.ARO.Test
serviceGroup: Microsoft.Azure.ARO.HCP.Management.Infra
rolloutName: Management Cluster Rollout
resourceGroups:
- name: {{ .svc.rg }}
Expand All @@ -16,14 +16,17 @@ resourceGroups:
action: ARM
template: templates/mgmt-cluster.bicep
parameters: configurations/mgmt-cluster.tmpl.bicepparam
inputs:
- name: clusterServiceMIResourceId
step: regionOutput
output: cs.msi.resourceID
variables:
- name: mgmt.clusterServiceResourceId
input:
step: regionOutput
name: cs
dependsOn:
- regionOutput
- name: enable-metrics
action: Shell
command: scripts/enable-aks-metrics.sh
env:
variables:
- name: RESOURCEGROUP
configRef: mgmt.rg
- name: AKS_NAME
Expand Down
6 changes: 1 addition & 5 deletions dev-infrastructure/templates/outputs/region.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@ resource csMSI 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
location: resourceGroup().location
}

output cs object = {
msi: {
resourceID: csMSI.id
}
}
output cs string = csMSI.id

0 comments on commit a8da435

Please sign in to comment.