diff --git a/config/pipeline.schema.json b/config/pipeline.schema.json new file mode 100644 index 000000000..868fd0d65 --- /dev/null +++ b/config/pipeline.schema.json @@ -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" + ] +} diff --git a/dev-infrastructure/mgmt-pipeline.yaml b/dev-infrastructure/mgmt-pipeline.yaml index 9f8747241..62e6c8b40 100644 --- a/dev-infrastructure/mgmt-pipeline.yaml +++ b/dev-infrastructure/mgmt-pipeline.yaml @@ -1,4 +1,4 @@ -serviceGroup: Microsoft.Azure.ARO.Test +serviceGroup: Microsoft.Azure.ARO.HCP.Management.Infra rolloutName: Management Cluster Rollout resourceGroups: - name: {{ .svc.rg }} @@ -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 diff --git a/dev-infrastructure/templates/outputs/region.bicep b/dev-infrastructure/templates/outputs/region.bicep index 2f4bbaa54..da5bbaaad 100644 --- a/dev-infrastructure/templates/outputs/region.bicep +++ b/dev-infrastructure/templates/outputs/region.bicep @@ -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