diff --git a/v0/pipeline/stages/cd/execution-wrapper-config.yaml b/v0/pipeline/stages/cd/execution-wrapper-config.yaml index 5f4377f4d..b4cefcbfc 100644 --- a/v0/pipeline/stages/cd/execution-wrapper-config.yaml +++ b/v0/pipeline/stages/cd/execution-wrapper-config.yaml @@ -182,6 +182,8 @@ properties: - $ref: ../../steps/cd/stand-alone-traffic-shift-rollback-step-node.yaml - $ref: ../../steps/cd/elastigroup-blue-green-traffic-shift-step-node.yaml - $ref: ../../steps/ci/s3-upload-node.yaml + - $ref: ../../steps/common/db-schema-update-sql-step-node.yaml + - $ref: ../../steps/common/db-schema-rollback-sql-step-node.yaml stepGroup: $ref: step-group-element-config.yaml diff --git a/v0/pipeline/stages/custom/execution-wrapper-config.yaml b/v0/pipeline/stages/custom/execution-wrapper-config.yaml index a603862f4..1e27ab505 100644 --- a/v0/pipeline/stages/custom/execution-wrapper-config.yaml +++ b/v0/pipeline/stages/custom/execution-wrapper-config.yaml @@ -74,6 +74,8 @@ properties: - $ref: ../../steps/custom/event-listener-step-node.yaml - $ref: ../../steps/cd/helm-delete-step-node.yaml - $ref: ../../steps/ci/s3-upload-node.yaml + - $ref: ../../steps/common/db-schema-update-sql-step-node.yaml + - $ref: ../../steps/common/db-schema-rollback-sql-step-node.yaml stepGroup: $ref: step-group-element-config.yaml diff --git a/v0/pipeline/steps/common/db-schema-rollback-sql-step-info.yaml b/v0/pipeline/steps/common/db-schema-rollback-sql-step-info.yaml new file mode 100644 index 000000000..faf4b7ec9 --- /dev/null +++ b/v0/pipeline/steps/common/db-schema-rollback-sql-step-info.yaml @@ -0,0 +1,148 @@ +title: DBSchemaRollbackSQLInfo +allOf: + - $ref: ../../common/step-spec-type.yaml + - type: object + required: + - connectorRef + - dbInstance + - dbSchema + oneOf: + - required: [tag] + not: + required: [changeSetCount] + - required: [changeSetCount] + not: + required: [tag] + properties: + dbInstance: + type: string + dbSchema: + type: string + connectorRef: + type: string + globalSettings: + type: object + additionalProperties: + type: string + settings: + oneOf: + - type: object + additionalProperties: + type: string + - type: string + tag: + type: string + minLength: 1 + changeSetCount: + type: integer + minimum: 1 + delegateSelectors: + oneOf: + - type: array + items: + type: string + - type: string + pattern: (<\+.+>.*) + minLength: 1 + envVariables: + oneOf: + - type: object + additionalProperties: + type: string + - type: string + image: + type: string + imagePullPolicy: + oneOf: + - type: string + enum: + - Always + - Never + - IfNotPresent + - type: string + pattern: (<\+.+>.*) + minLength: 1 + privileged: + oneOf: + - type: boolean + - type: string + pattern: ^<\+input>((\.)((executionInput\(\))|(allowedValues|selectOneFrom|default|regex)\(.+?\)))*$ + minLength: 1 + resources: + $ref: ../../common/container-resource.yaml + runAsUser: + oneOf: + - type: integer + format: int32 + - type: string +$schema: http://json-schema.org/draft-07/schema# +type: object +required: + - connectorRef + - dbInstance + - dbSchema +oneOf: + - required: [tag] + not: + required: [changeSetCount] + - required: [changeSetCount] + not: + required: [tag] +properties: + dbInstance: + type: string + dbSchema: + type: string + connectorRef: + type: string + tag: + type: string + minLength: 1 + changeSetCount: + type: integer + minimum: 1 + settings: + oneOf: + - $ref: ../../common/parameter-field-map-string-json-node.yaml + - type: string + delegateSelectors: + oneOf: + - type: array + items: + type: string + - type: string + pattern: (<\+.+>.*) + minLength: 1 + envVariables: + oneOf: + - type: object + additionalProperties: + type: string + - type: string + image: + type: string + imagePullPolicy: + oneOf: + - type: string + enum: + - Always + - Never + - IfNotPresent + - type: string + pattern: (<\+.+>.*) + minLength: 1 + privileged: + oneOf: + - type: boolean + - type: string + pattern: ^<\+input>((\.)((executionInput\(\))|(allowedValues|selectOneFrom|default|regex)\(.+?\)))*$ + minLength: 1 + resources: + $ref: ../../common/container-resource.yaml + runAsUser: + oneOf: + - type: integer + format: int32 + - type: string + description: + desc: This is the description for DBSchemaRollbackSQLInfo diff --git a/v0/pipeline/steps/common/db-schema-rollback-sql-step-node.yaml b/v0/pipeline/steps/common/db-schema-rollback-sql-step-node.yaml new file mode 100644 index 000000000..b2f227ab6 --- /dev/null +++ b/v0/pipeline/steps/common/db-schema-rollback-sql-step-node.yaml @@ -0,0 +1,55 @@ +title: DBSchemaRollbackSQLNode +type: object +required: + - identifier + - name + - type +properties: + description: + type: string + desc: This is the description for DBSchemaRollbackSQLNode + enforce: + $ref: ../../common/policy-config.yaml + failureStrategies: + oneOf: + - type: array + items: + $ref: ../../common/db-devops-failure-strategy-config.yaml + - type: string + pattern: ^<\+input>$ + minLength: 1 + identifier: + type: string + pattern: ^[a-zA-Z_][0-9a-zA-Z_]{0,127}$ + name: + type: string + pattern: ^[a-zA-Z_0-9-.][-0-9a-zA-Z_\s.]{0,127}$ + strategy: + oneOf: + - $ref: ../../common/strategy-config.yaml + - type: string + pattern: ^<\+input>$ + minLength: 1 + timeout: + type: string + pattern: ^(([1-9])+\d+[s])|(((([1-9])+\d*[mhwd])+([\s]?\d+[smhwd])*)|(.*<\+.*>(?!.*\.executionInput\(\)).*)|(^$))$ + type: + type: string + enum: + - DBSchemaRollbackSQL + when: + oneOf: + - $ref: ../../common/step-when-condition.yaml + - type: string + pattern: ^<\+input>$ + minLength: 1 +$schema: http://json-schema.org/draft-07/schema# +allOf: + - if: + properties: + type: + const: DBSchemaRollbackSQL + then: + properties: + spec: + $ref: db-schema-rollback-sql-step-info.yaml diff --git a/v0/pipeline/steps/common/db-schema-update-sql-step-info.yaml b/v0/pipeline/steps/common/db-schema-update-sql-step-info.yaml new file mode 100644 index 000000000..f3943f37f --- /dev/null +++ b/v0/pipeline/steps/common/db-schema-update-sql-step-info.yaml @@ -0,0 +1,122 @@ +title: DBSchemaUpdateSQLInfo +allOf: +- $ref: ../../common/step-spec-type.yaml +- type: object + required: + - connectorRef + - dbSchema + - dbInstance + properties: + dbInstance: + type: string + dbSchema: + type: string + connectorRef: + type: string + globalSettings: + type: object + additionalProperties: + type: string + settings: + oneOf: + - type: object + additionalProperties: + type: string + - type: string + delegateSelectors: + oneOf: + - type: array + items: + type: string + - type: string + pattern: (<\+.+>.*) + minLength: 1 + envVariables: + oneOf: + - type: object + additionalProperties: + type: string + - type: string + image: + type: string + imagePullPolicy: + oneOf: + - type: string + enum: + - Always + - Never + - IfNotPresent + - type: string + pattern: (<\+.+>.*) + minLength: 1 + privileged: + oneOf: + - type: boolean + - type: string + pattern: ^<\+input>((\.)((executionInput\(\))|(allowedValues|selectOneFrom|default|regex)\(.+?\)))*$ + minLength: 1 + resources: + $ref: ../../common/container-resource.yaml + runAsUser: + oneOf: + - type: integer + format: int32 + - type: string +$schema: http://json-schema.org/draft-07/schema# +type: object +required: +- connectorRef +- dbSchema +- dbInstance +properties: + dbInstance: + type: string + dbSchema: + type: string + connectorRef: + type: string + settings: + oneOf: + - $ref: ../../common/parameter-field-map-string-json-node.yaml + - type: string + delegateSelectors: + oneOf: + - type: array + items: + type: string + - type: string + pattern: (<\+.+>.*) + minLength: 1 + envVariables: + oneOf: + - type: object + additionalProperties: + type: string + - type: string + image: + type: string + imagePullPolicy: + oneOf: + - type: string + enum: + - Always + - Never + - IfNotPresent + - type: string + pattern: (<\+.+>.*) + minLength: 1 + privileged: + oneOf: + - type: boolean + - type: string + pattern: ^<\+input>((\.)((executionInput\(\))|(allowedValues|selectOneFrom|default|regex)\(.+?\)))*$ + minLength: 1 + resources: + $ref: ../../common/container-resource.yaml + runAsUser: + oneOf: + - type: integer + format: int32 + - type: string + description: + desc: This is the description for DBSchemaUpdateSQLInfo diff --git a/v0/pipeline/steps/common/db-schema-update-sql-step-node.yaml b/v0/pipeline/steps/common/db-schema-update-sql-step-node.yaml new file mode 100644 index 000000000..18c58a1b6 --- /dev/null +++ b/v0/pipeline/steps/common/db-schema-update-sql-step-node.yaml @@ -0,0 +1,55 @@ +title: DBSchemaUpdateSQLNode +type: object +required: +- identifier +- name +- type +properties: + description: + type: string + desc: This is the description for DBSchemaUpdateSQLNode + enforce: + $ref: ../../common/policy-config.yaml + failureStrategies: + oneOf: + - type: array + items: + $ref: ../../common/db-devops-failure-strategy-config.yaml + - type: string + pattern: ^<\+input>$ + minLength: 1 + identifier: + type: string + pattern: ^[a-zA-Z_][0-9a-zA-Z_]{0,127}$ + name: + type: string + pattern: ^[a-zA-Z_0-9-.][-0-9a-zA-Z_\s.]{0,127}$ + strategy: + oneOf: + - $ref: ../../common/strategy-config.yaml + - type: string + pattern: ^<\+input>$ + minLength: 1 + timeout: + type: string + pattern: ^(([1-9])+\d+[s])|(((([1-9])+\d*[mhwd])+([\s]?\d+[smhwd])*)|(.*<\+.*>(?!.*\.executionInput\(\)).*)|(^$))$ + type: + type: string + enum: + - DBSchemaUpdateSQL + when: + oneOf: + - $ref: ../../common/step-when-condition.yaml + - type: string + pattern: ^<\+input>$ + minLength: 1 +$schema: http://json-schema.org/draft-07/schema# +allOf: +- if: + properties: + type: + const: DBSchemaUpdateSQL + then: + properties: + spec: + $ref: db-schema-update-sql-step-info.yaml diff --git a/v0/pipeline/steps/common/dbops-rollback-schema-step-info.yaml b/v0/pipeline/steps/common/dbops-rollback-schema-step-info.yaml index d1873351f..cd0d05d46 100644 --- a/v0/pipeline/steps/common/dbops-rollback-schema-step-info.yaml +++ b/v0/pipeline/steps/common/dbops-rollback-schema-step-info.yaml @@ -20,6 +20,12 @@ allOf: type: string connectorRef: type: string + settings: + oneOf: + - type: object + additionalProperties: + type: string + - type: string globalSettings: type: object additionalProperties: @@ -95,6 +101,10 @@ properties: changeSetCount: type: integer minimum: 1 + settings: + oneOf: + - $ref: ../../common/parameter-field-map-string-json-node.yaml + - type: string delegateSelectors: oneOf: - type: array diff --git a/v0/template/template_config.yaml b/v0/template/template_config.yaml index 5daeb8dcb..2fbbac188 100644 --- a/v0/template/template_config.yaml +++ b/v0/template/template_config.yaml @@ -259,6 +259,8 @@ step_template_types: - ../pipeline/steps/common/artifact-verification-step-node.yaml - ../pipeline/steps/common/provenance-step-node.yaml - ../pipeline/steps/common/ssca-compliance-step-node.yaml + - ../pipeline/steps/common/db-schema-update-sql-step-node.yaml + - ../pipeline/steps/common/db-schema-rollback-sql-step-node.yaml stage_template_types: - ../pipeline/stages/custom/custom-stage-node.yaml