diff --git a/azure-aro/specs/service-spec.json.tpl b/azure-aro/specs/service-spec.json.tpl index d18a2d7c..36541088 100644 --- a/azure-aro/specs/service-spec.json.tpl +++ b/azure-aro/specs/service-spec.json.tpl @@ -203,7 +203,47 @@ } }, "type":"Control", + "scope":"#/properties/continuous_delivery/properties/mode" + }, + { + "rule":{ + "effect":"SHOW", + "condition":{ + "type":"AND", + "conditions":[ + { + "scope":"#/properties/continuous_delivery/properties/enabled", + "schema":{"const":true} + }, + { + "scope":"#/properties/continuous_delivery/properties/mode", + "schema":{"const":"branch"} + } + ] + } + }, + "type":"Control", "scope":"#/properties/continuous_delivery/properties/branches" + }, + { + "rule":{ + "effect":"SHOW", + "condition":{ + "type":"AND", + "conditions":[ + { + "scope":"#/properties/continuous_delivery/properties/enabled", + "schema":{"const":true} + }, + { + "scope":"#/properties/continuous_delivery/properties/mode", + "schema":{"const":"release"} + } + ] + } + }, + "type":"Control", + "scope":"#/properties/continuous_delivery/properties/releases" } ] }, @@ -571,15 +611,21 @@ "type":"object", "title":"Continuous Delivery", "required":[ - "enabled", - "branches" + "enabled" ], "properties":{ "enabled":{ "type":"boolean", "title":"Enable Continuous Delivery", "default":false, - "description":"Automatically deploy new versions from specified branches" + "description":"Automatically deploy new versions from specified branches or releases" + }, + "mode":{ + "type":"string", + "title":"Mode", + "enum":["branch", "release"], + "default":"branch", + "description":"Deploy based on branch builds or release creation" }, "branches":{ "type":"array", @@ -591,9 +637,15 @@ "main" ], "description":"Git branches to monitor for automatic deployment" + }, + "releases":{ + "type":"string", + "title":"Releases (Semver)", + "default":".*", + "description":"Semver regex pattern to match releases for automatic deployment (e.g., v\\d+\\.\\d+\\.\\d+)" } }, - "description":"Configure automatic deployment from Git branches" + "description":"Configure automatic deployment from Git branches or releases" }, "custom_domains": { "type": "object", diff --git a/azure/specs/service-spec.json.tpl b/azure/specs/service-spec.json.tpl index ca47ae5d..8ea75116 100644 --- a/azure/specs/service-spec.json.tpl +++ b/azure/specs/service-spec.json.tpl @@ -203,7 +203,47 @@ } }, "type":"Control", + "scope":"#/properties/continuous_delivery/properties/mode" + }, + { + "rule":{ + "effect":"SHOW", + "condition":{ + "type":"AND", + "conditions":[ + { + "scope":"#/properties/continuous_delivery/properties/enabled", + "schema":{"const":true} + }, + { + "scope":"#/properties/continuous_delivery/properties/mode", + "schema":{"const":"branch"} + } + ] + } + }, + "type":"Control", "scope":"#/properties/continuous_delivery/properties/branches" + }, + { + "rule":{ + "effect":"SHOW", + "condition":{ + "type":"AND", + "conditions":[ + { + "scope":"#/properties/continuous_delivery/properties/enabled", + "schema":{"const":true} + }, + { + "scope":"#/properties/continuous_delivery/properties/mode", + "schema":{"const":"release"} + } + ] + } + }, + "type":"Control", + "scope":"#/properties/continuous_delivery/properties/releases" } ] }, @@ -571,15 +611,21 @@ "type":"object", "title":"Continuous Delivery", "required":[ - "enabled", - "branches" + "enabled" ], "properties":{ "enabled":{ "type":"boolean", "title":"Enable Continuous Delivery", "default":false, - "description":"Automatically deploy new versions from specified branches" + "description":"Automatically deploy new versions from specified branches or releases" + }, + "mode":{ + "type":"string", + "title":"Mode", + "enum":["branch", "release"], + "default":"branch", + "description":"Deploy based on branch builds or release creation" }, "branches":{ "type":"array", @@ -591,9 +637,15 @@ "main" ], "description":"Git branches to monitor for automatic deployment" + }, + "releases":{ + "type":"string", + "title":"Releases (Semver)", + "default":".*", + "description":"Semver regex pattern to match releases for automatic deployment (e.g., v\\d+\\.\\d+\\.\\d+)" } }, - "description":"Configure automatic deployment from Git branches" + "description":"Configure automatic deployment from Git branches or releases" }, "custom_domains": { "type": "object", diff --git a/k8s/specs/service-spec.json.tpl b/k8s/specs/service-spec.json.tpl index ca47ae5d..8ea75116 100644 --- a/k8s/specs/service-spec.json.tpl +++ b/k8s/specs/service-spec.json.tpl @@ -203,7 +203,47 @@ } }, "type":"Control", + "scope":"#/properties/continuous_delivery/properties/mode" + }, + { + "rule":{ + "effect":"SHOW", + "condition":{ + "type":"AND", + "conditions":[ + { + "scope":"#/properties/continuous_delivery/properties/enabled", + "schema":{"const":true} + }, + { + "scope":"#/properties/continuous_delivery/properties/mode", + "schema":{"const":"branch"} + } + ] + } + }, + "type":"Control", "scope":"#/properties/continuous_delivery/properties/branches" + }, + { + "rule":{ + "effect":"SHOW", + "condition":{ + "type":"AND", + "conditions":[ + { + "scope":"#/properties/continuous_delivery/properties/enabled", + "schema":{"const":true} + }, + { + "scope":"#/properties/continuous_delivery/properties/mode", + "schema":{"const":"release"} + } + ] + } + }, + "type":"Control", + "scope":"#/properties/continuous_delivery/properties/releases" } ] }, @@ -571,15 +611,21 @@ "type":"object", "title":"Continuous Delivery", "required":[ - "enabled", - "branches" + "enabled" ], "properties":{ "enabled":{ "type":"boolean", "title":"Enable Continuous Delivery", "default":false, - "description":"Automatically deploy new versions from specified branches" + "description":"Automatically deploy new versions from specified branches or releases" + }, + "mode":{ + "type":"string", + "title":"Mode", + "enum":["branch", "release"], + "default":"branch", + "description":"Deploy based on branch builds or release creation" }, "branches":{ "type":"array", @@ -591,9 +637,15 @@ "main" ], "description":"Git branches to monitor for automatic deployment" + }, + "releases":{ + "type":"string", + "title":"Releases (Semver)", + "default":".*", + "description":"Semver regex pattern to match releases for automatic deployment (e.g., v\\d+\\.\\d+\\.\\d+)" } }, - "description":"Configure automatic deployment from Git branches" + "description":"Configure automatic deployment from Git branches or releases" }, "custom_domains": { "type": "object", diff --git a/scheduled_task/specs/service-spec.json.tpl b/scheduled_task/specs/service-spec.json.tpl index f6ce2009..c15cc60f 100644 --- a/scheduled_task/specs/service-spec.json.tpl +++ b/scheduled_task/specs/service-spec.json.tpl @@ -28,8 +28,21 @@ "type": "string" }, "continuous_delivery": { - "description": "Configure automatic deployment from Git branches", + "description": "Configure automatic deployment from Git branches or releases", "properties": { + "enabled": { + "default": false, + "description": "Automatically deploy new versions from specified branches or releases", + "title": "Enable Continuous Delivery", + "type": "boolean" + }, + "mode": { + "type": "string", + "title": "Mode", + "enum": ["branch", "release"], + "default": "branch", + "description": "Deploy based on branch builds or release creation" + }, "branches": { "default": [ "main" @@ -41,16 +54,15 @@ "title": "Branches", "type": "array" }, - "enabled": { - "default": false, - "description": "Automatically deploy new versions from specified branches", - "title": "Enable Continuous Delivery", - "type": "boolean" + "releases": { + "type": "string", + "title": "Releases (Semver)", + "default": ".*", + "description": "Semver regex pattern to match releases for automatic deployment (e.g., v\\d+\\.\\d+\\.\\d+)" } }, "required": [ - "enabled", - "branches" + "enabled" ], "title": "Continuous Delivery", "type": "object" @@ -260,8 +272,48 @@ }, "effect": "SHOW" }, + "scope": "#/properties/continuous_delivery/properties/mode", + "type": "Control" + }, + { + "rule": { + "condition": { + "type": "AND", + "conditions": [ + { + "scope": "#/properties/continuous_delivery/properties/enabled", + "schema": {"const": true} + }, + { + "scope": "#/properties/continuous_delivery/properties/mode", + "schema": {"const": "branch"} + } + ] + }, + "effect": "SHOW" + }, "scope": "#/properties/continuous_delivery/properties/branches", "type": "Control" + }, + { + "rule": { + "condition": { + "type": "AND", + "conditions": [ + { + "scope": "#/properties/continuous_delivery/properties/enabled", + "schema": {"const": true} + }, + { + "scope": "#/properties/continuous_delivery/properties/mode", + "schema": {"const": "release"} + } + ] + }, + "effect": "SHOW" + }, + "scope": "#/properties/continuous_delivery/properties/releases", + "type": "Control" } ], "label": "Continuous deployment",