Skip to content

Commit

Permalink
Merge pull request #15 from gustavosbarreto/mender
Browse files Browse the repository at this point in the history
metadata: add mender object
  • Loading branch information
otavio authored Feb 23, 2018
2 parents 1de8c71 + b9579a2 commit a1abc70
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkgschema/schemas/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"mode": {
"description": "Represents the install mode for the object data",
"type": "string",
"enum": ["copy", "flash", "imxkobs", "raw", "tarball", "ubifs"]
"enum": ["copy", "flash", "imxkobs", "raw", "tarball", "ubifs", "mender"]
},
"filename": {
"description": "file name used by client to rebuild the commit",
Expand Down
33 changes: 33 additions & 0 deletions pkgschema/schemas/mender-object.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",

"title": "Mender object",
"description": "Object specifications for Mender mode",

"type": "object",

"properties": {
"mode": {
"$ref": "definitions.json#/mode"
},
"filename": {
"$ref": "definitions.json#/filename"
}
},

"required": [
"filename"
],

"additionalProperties": false,

"dependencies": {
"mode": {
"properties": {
"mode": {
"enum": ["mender"]
}
}
}
}
}
3 changes: 2 additions & 1 deletion pkgschema/schemas/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
{"$ref": "imxkobs-object.json"},
{"$ref": "raw-object.json"},
{"$ref": "tarball-object.json"},
{"$ref": "ubifs-object.json"}
{"$ref": "ubifs-object.json"},
{"$ref": "mender-object.json"}
]
},
"minItems": 1
Expand Down
4 changes: 4 additions & 0 deletions tests/pkgschema/fixture-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
"target": "/dev/sda",
"target-path": "/usr/bin/python",
"mount-options": "-a"
},
{
"mode": "mender",
"filename": "artifact.mender"
}
]
]
Expand Down
4 changes: 4 additions & 0 deletions tests/schemas/fixtures/mender-object/expected-document.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"filename": "artifact.mender",
"mode": "mender"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"filename": 1,
"mode": "mender"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"mode": "tarball",
"filename": "artifact.mender"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"mode": "mender"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"filename": "artifact.mender"
}

0 comments on commit a1abc70

Please sign in to comment.