From 7c00fd2761e6efffe763ece5d08d9a6d3fb95092 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Mon, 5 Oct 2020 19:46:28 -0700 Subject: Add interface with json schema, fix flake-less issues, put setActivate and jsonSchema check in flake lib --- interface/deploy.json | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 interface/deploy.json (limited to 'interface/deploy.json') diff --git a/interface/deploy.json b/interface/deploy.json new file mode 100644 index 0000000..aaa6534 --- /dev/null +++ b/interface/deploy.json @@ -0,0 +1,103 @@ +{ + "$schema": "http://json-schema.org/draft/2019-09/schema#", + "title": "Deploy", + "description": "Matches a correct deploy attribute of a flake", + "definitions": { + "generic_settings": { + "type": "object", + "properties": { + "sshUser": { + "type": "string" + }, + "user": { + "type": "string" + }, + "sshOpts": { + "type": "array", + "items": { + "type": "string" + } + }, + "fastConnection": { + "type": "boolean" + }, + "autoRollback": { + "type": "boolean" + } + } + }, + "node_settings": { + "type": "object", + "properties": { + "hostname": { + "type": "string" + } + }, + "required": [ + "hostname" + ] + }, + "profile_settings": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "bootstrap": { + "type": "string" + } + }, + "required": [ + "path" + ] + } + }, + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/generic_settings" + }, + { + "type": "object", + "properties": { + "nodes": { + "type": "object", + "patternProperties": { + "[A-z][A-z0-9_-]*": { + "allOf": [ + { + "$ref": "#/definitions/generic_settings" + }, + { + "$ref": "#/definitions/node_settings" + }, + { + "type": "object", + "properties": { + "profiles": { + "type": "object", + "patternProperties": { + "[A-z][A-z0-9_-]*": { + "allOf": [ + { + "$ref": "#/definitions/generic_settings" + }, + { + "$ref": "#/definitions/profile_settings" + } + ] + } + }, + "additionalProperties": false + } + } + } + ] + } + }, + "additionalProperties": false + } + } + } + ] +} \ No newline at end of file -- cgit v1.2.3 From aabcf6b77d4159100a49b143cbb8da4bad194f14 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Mon, 5 Oct 2020 20:10:41 -0700 Subject: Improve schema a bit, fix flake locks for examples --- interface/deploy.json | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'interface/deploy.json') diff --git a/interface/deploy.json b/interface/deploy.json index aaa6534..310e926 100644 --- a/interface/deploy.json +++ b/interface/deploy.json @@ -31,6 +31,29 @@ "properties": { "hostname": { "type": "string" + }, + "profilesOrder": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "profiles": { + "type": "object", + "patternProperties": { + "[A-z][A-z0-9_-]*": { + "allOf": [ + { + "$ref": "#/definitions/generic_settings" + }, + { + "$ref": "#/definitions/profile_settings" + } + ] + } + }, + "additionalProperties": false } }, "required": [ @@ -70,27 +93,6 @@ }, { "$ref": "#/definitions/node_settings" - }, - { - "type": "object", - "properties": { - "profiles": { - "type": "object", - "patternProperties": { - "[A-z][A-z0-9_-]*": { - "allOf": [ - { - "$ref": "#/definitions/generic_settings" - }, - { - "$ref": "#/definitions/profile_settings" - } - ] - } - }, - "additionalProperties": false - } - } } ] } -- cgit v1.2.3 From db8301a45796cd919cbfa085f85ac6288e73a8db Mon Sep 17 00:00:00 2001 From: notgne2 Date: Sat, 10 Oct 2020 10:31:55 -0700 Subject: Add profile path option to profiles --- interface/deploy.json | 3 +++ 1 file changed, 3 insertions(+) (limited to 'interface/deploy.json') diff --git a/interface/deploy.json b/interface/deploy.json index 310e926..19da486 100644 --- a/interface/deploy.json +++ b/interface/deploy.json @@ -68,6 +68,9 @@ }, "bootstrap": { "type": "string" + }, + "profilePath": { + "type": "string" } }, "required": [ -- cgit v1.2.3 From ea717911bac5ff29d730d80d4b774fe17ed1e851 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Tue, 13 Oct 2020 19:06:40 -0700 Subject: Clean up some CLI arguments, make magic rollback optional --- interface/deploy.json | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'interface/deploy.json') diff --git a/interface/deploy.json b/interface/deploy.json index 19da486..93bacb8 100644 --- a/interface/deploy.json +++ b/interface/deploy.json @@ -23,6 +23,15 @@ }, "autoRollback": { "type": "boolean" + }, + "magicRollback": { + "type": "boolean" + }, + "confirmTimeout": { + "type": "int" + }, + "tempPath": { + "type": "integer" } } }, -- cgit v1.2.3 From c7b1e9d9617ef02f974f56a47f4a0ee3fbf4020e Mon Sep 17 00:00:00 2001 From: notgne2 Date: Tue, 13 Oct 2020 19:10:07 -0700 Subject: Fix json schema --- interface/deploy.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'interface/deploy.json') diff --git a/interface/deploy.json b/interface/deploy.json index 93bacb8..fa45e50 100644 --- a/interface/deploy.json +++ b/interface/deploy.json @@ -28,10 +28,10 @@ "type": "boolean" }, "confirmTimeout": { - "type": "int" + "type": "integer" }, "tempPath": { - "type": "integer" + "type": "string" } } }, -- cgit v1.2.3