How the YAML files look
Getting started 4 · 3:44
An integration's folder has several YAML files, from Camel's route file to Weik.io's deployment documents, and each has its own shape. The video goes through keys, indentation, lists and comments, and weikio validate finds a misspelled field before anything reaches Weik.io.
This part of the video couldn't be loaded.
What it covers
- The folder of files that
weikio init hellowrites - Keys, indentation and list dashes in the route file
hello.camel.yaml - Comments in
integration.yamlthat show the fields it may declare - How Camel's route file, the flat
integration.yamland Weik.io's documents differ kind,metadataandspecin a deployment document- A misspelled field caught by
weikio validate, with its file and line
Commands in this video
Terminal
$ weikio init hello
$ weikio validate -f ./hello
$ weikio validate -f .Transcript
- 0:01This video reads an integration folder's files, YAML included.
- 0:05They're plain text that reads as it stands, and fits in Git.
- 0:12Your machine's working folder is empty.
- 0:15The Weik.io CLI signs in through a context.
- 0:18The context reaches your Weik.io installation, and no file crosses.
- 0:27weikio init hello writes a new integration into a folder.
- 0:32The reply prints a line for each new file,
- 0:35then names the context's project and environment.
- 0:39The files: hello.camel.yaml, application.properties and integration.yaml.
- 0:50This is hello.camel.yaml, the route file.
- 0:54A key can hold more keys indented under it:
- 0:57from carries uri and parameters, and indentation, not punctuation, is the structure.
- 1:04Every list item opens with a dash: steps holds the route's two steps.
- 1:12This is integration.yaml: name holds the integration's name.
- 1:17A hash at the start of a line makes it a comment, skipped by every tool.
- 1:21The commented lines show where the other fields go.
- 1:27application.properties isn't YAML.
- 1:30Its line is key, equals, value: the properties shape,
- 1:35and the route's message source.
- 1:41The route file is Camel's own YAML.
- 1:44integration.yaml is optional: it says what the integration needs.
- 1:49The third shape: a document file holds one thing the hub stores.
- 1:54Your document is in a devtest folder beside hello.
- 1:57Documents can share a file, split by three dashes.
- 2:01application.properties is none of these three shapes.
- 2:09A deployment document opens with four keys:
- 2:12kind reads deployment, lower case: this document says what runs, and where.
- 2:19metadata names the integration, project and environment, spec gives version 0.1.0.
- 2:30Integration.yaml again: an edit uncommented the version field on line 3,
- 2:37but mistyped its name.
- 2:39weikio validate over the hello folder checks the files before anything is built or reaches the installation.
- 2:47The finding names the file, line and field, and marks that line in the panel.
- 2:56The fix: restore the version field's correct name.
- 3:00Now weikio validate over the whole working folder checks the corrected hello folder and the deployment document together.
- 3:08The check passed over both folders: files are checked where they stand,
- 3:12on your machine, before anything reaches the hub.
- 3:19The folder's files, one rule each.
- 3:22Camel's own YAML is the route's shape.
- 3:25integration.yaml is optional, in the flat form.
- 3:31Each document file holds one stored thing.
- 3:34The last check came back clean.