Skip to content

Commit

Permalink
Prepare snapshot -> backup migration (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Jul 14, 2021
1 parent 597b800 commit ca747f8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
29 changes: 23 additions & 6 deletions src/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@
"default": false,
"type": "boolean"
},
"backup": {
"default": "hot",
"enum": ["hot", "cold"],
"type": "string"
},
"backup_exclude": {
"items": {
"type": "string"
},
"type": "array"
},
"backup_pre": {
"type": "string"
},
"backup_post": {
"type": "string"
},
"boot": {
"default": "auto",
"enum": ["auto", "manual"],
Expand Down Expand Up @@ -225,18 +242,18 @@
"enum": ["hot", "cold"],
"type": "string"
},
"snapshot_pre": {
"type": "string"
},
"snapshot_post": {
"type": "string"
},
"snapshot_exclude": {
"items": {
"type": "string"
},
"type": "array"
},
"snapshot_pre": {
"type": "string"
},
"snapshot_post": {
"type": "string"
},
"stage": {
"default": "stable",
"enum": ["deprecated", "experimental", "stable"],
Expand Down
8 changes: 8 additions & 0 deletions src/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ def is_default(validator, properties, instance, schema):
)
exit_code = 1

if configuration.get("backup", "hot") == "cold":
for option in ["backup_pre", "backup_post"]:
if option in configuration:
print(
f"::error file={config}::'{option}' is not valid when using cold backups."
)
exit_code = 1

# Checks regarding build file(if found)
for file_type in ("json", "yaml", "yml"):
build = path / f"build.{file_type}"
Expand Down

0 comments on commit ca747f8

Please sign in to comment.