diff options
author | notgne2 | 2020-10-26 21:05:03 -0700 |
---|---|---|
committer | notgne2 | 2020-10-26 21:05:03 -0700 |
commit | 997d1151fd3d303eaa9c2c41312ff87eee986418 (patch) | |
tree | 229deae6687a5b454cf2417fcb022a78f8ac20b8 /interface | |
parent | 30197f8a352c879f0070e059ebc117dc17e8270f (diff) | |
parent | df002c31a64409350a3cb8825364542c65a4d00a (diff) |
Merge branch 'master' into review
Diffstat (limited to '')
-rw-r--r-- | interface/README.md | 39 | ||||
-rw-r--r-- | interface/deploy.json | 117 | ||||
-rw-r--r-- | interface/deploy.json.license | 3 |
3 files changed, 159 insertions, 0 deletions
diff --git a/interface/README.md b/interface/README.md new file mode 100644 index 0000000..f61a69f --- /dev/null +++ b/interface/README.md @@ -0,0 +1,39 @@ +<!-- +SPDX-FileCopyrightText: 2020 Serokell <https://serokell.io/> + +SPDX-License-Identifier: MPL-2.0 +--> + +A flake must have a `deploy` output with the following structure: + +``` +deploy +├── <generic args> +└── nodes + ├── <NODE> + │ ├── <generic args> + │ ├── hostname + │ ├── profilesOrder + │ └── profiles + │ ├── <PROFILE> + │ │ ├── <generic args> + │ │ ├── bootstrap + │ │ ├── profilePath + │ │ └── path + │ └── <PROFILE>... + └── <NODE>... +``` + +Where `<generic args>` are all optional and can be one or multiple of: + +- `sshUser` -- user to connect as +- `user` -- user to install and activate profiles with +- `sshOpts` -- options passed to `nix copy` and `ssh` +- `fastConnection` -- whether the connection from this host to the target one is fast (if it is, don't substitute on target and copy the entire closure) [default: `false`] +- `autoRollback` -- whether to roll back when the deployment fails [default: `false`] + +A formal definition for the structure can be found in [the JSON schema](./deploy.json) + +For every profile of every node, arguments are merged with `<PROFILE>` taking precedence over `<NODE>` and `<NODE>` taking precedence over top-level. + +Certain read values can be overridden by supplying flags to the deploy binary, for example `deploy --auto-rollback true .` will enable automatic rollback for all nodes being deployed to, regardless of settings.
\ No newline at end of file diff --git a/interface/deploy.json b/interface/deploy.json new file mode 100644 index 0000000..fa45e50 --- /dev/null +++ b/interface/deploy.json @@ -0,0 +1,117 @@ +{ + "$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" + }, + "magicRollback": { + "type": "boolean" + }, + "confirmTimeout": { + "type": "integer" + }, + "tempPath": { + "type": "string" + } + } + }, + "node_settings": { + "type": "object", + "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": [ + "hostname" + ] + }, + "profile_settings": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "bootstrap": { + "type": "string" + }, + "profilePath": { + "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" + } + ] + } + }, + "additionalProperties": false + } + } + } + ] +}
\ No newline at end of file diff --git a/interface/deploy.json.license b/interface/deploy.json.license new file mode 100644 index 0000000..9e9897d --- /dev/null +++ b/interface/deploy.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2020 Serokell <https://serokell.io/> + +SPDX-License-Identifier: MPL-2.0
\ No newline at end of file |