This repository has been archived by the owner on Feb 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
Sketch metadata specification
Ted Zlatanov edited this page Jun 3, 2014
·
1 revision
TODO: merge into howto/etch_a_sketch.md
Each sketch must include a JSON file named sketch.json
, which
contains all the information about the sketch.
Top-level attributes in sketch.json
:
Element | Type | Required | Description |
---|---|---|---|
manifest | Hash of hashes | Yes | List of files included in the sketch, in the form of a
hash indexed by filename. Only files declared in the manifest will
be copied when installing a sketch. The manifest hash must contain
at least one of:
|
metadata | Hash | Yes | Sketch-specific metadata. See below for the full description of all the metadata fields. |
entry_point | String | Yes | The name of the .cf file in which the entry bundle for the sketch is defined. This file must contain an agent bundle with an arbitrary name X, and another agent bundle with the name meta_X (this is, the main bundle name prepended with meta_). The entry point can also be set to null. In this case the sketch is considered as a "library sketch", which will be loaded but not explicitly executed. |
interface | Array | Yes | List of files from the sketch that need to be loaded in the CFEngine inputs attribute for the sketch to be functional. This list should include at least the entry_point file, but may include others as needed. |
Others | Any | No | Any other attributes may be included, but will not be explicitly used by cf-sketch. |
The following table lists all attributes that can be included in the
metadata
element:
Element | Type | Required | Description |
---|---|---|---|
name | String | Yes | Name of the sketch. It can be a simple name (e.g. "sketchname") or include a double-colon-separated namespace (e.g. "NS::sketchname"). All components of the name will be converted to directories when installing the sketch, so for example, "NS::sketchname" will be installed under <basedir>/NS/sketchname/". |
version | String | Yes | Sketch version number. It is interpreted as a string for comparison purposes (lexicographical sorting instead of numerical sorting) |
license | String | Yes | Name of the open-source license under which the sketch is released. For maximum flexibility, we strongly encourage you to use a permissive license such as MIT, BSD or Apache. The default license for all the sketches in the Design Center is MIT. |
tags | Array of strings | Yes | You can assign arbitrary sets of tags to sketches, for identification or classification purposes. All CFEngine-provided sketches have the "cfdc" tag assigned. |
authors | Array of strings | Yes | The names of the authors of the sketch. |
depends | Hash | Yes | Dependencies of the sketch, expressed as a hash indexed by
dependency name. The dependencies can be any of:
|
Others | Any | No | Any additional elements included in the metadata hash will not be used by cf-sketch itself, but will be made available to the sketch bundle (together with all the mandatory metadata attributes) during execution as variables of the form $($(prefix)sketch_<attribute>). For example, the sketch name is stored in variable $($(prefix)sketch_name). |
A public repository for customizable CFEngine design patterns and code.