The CPA (previously CHA) punch training module covers the channels, punchlines and applications design
Before You Start¶
Welcome to the Channels and applications design training module. This training requires you download the standalone punchplatform.
To begin, read the introduction of the Configuration Overview documentation. The basics are quite simple to understand : a punchline is contained in a channel and a channel is contained in a tenant.
We will go through these different parts one by one in the following tracks
HJSON vs Json, converting¶
Most of the configuration files are in yaml format. If you are not familiar with this syntax, take some time to understand how it works and the difference with plain json. Many online convertors are available to convert the one to the other.
The punch 6.x releases support (and will keep supporting) the hjson format. Hjson is nice, is json compatible and has many benefit to deal with human oriented configuration files. However it is not supported broadly and yaml can be as conveniently used.
Check the punch tool installed on your standalone :
hjson-manager. It makes it easy to convert
json / hjson / yaml files.
How to check if yaml/json or hjson files are valid ?
- A json file can be checked using
jq . myfile.json
A hjson file can be checked and converted to json at the same time using
hjson-manager. A tool shipped with the punch.
cat myfile.hjson | hjson-manager
If you want to convert json or hjson files to yaml:
cat myfile.hjson | hjson-manager --yaml > myfile.yaml
During the training track, examples are presented as part of the 'mytenant' working tenant. If training on a production or shared platform instead of a standalone, create your own tenant folder to work separately from other trainees.
If yo do not work with the
mytenanttenant, make sure to :
-t yourtenantas first parameter of all
channelctlcommands OR define your default tenant in your environment (
export PUNCHPLATFORM_TENANT=yourtenantin each of your window, or in your
change all references to 'mytenant' to 'yourtenant' in provided examples