From c9c8c13810beeef229fc34751c543015bbefa1e7 Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Fri, 15 Nov 2024 09:54:05 -0700 Subject: [PATCH] docs: replace touch with cat --- doc/md/tutorial/cue.mdx | 17 ++++++++++++++--- doc/md/tutorial/hello-holos.mdx | 16 ++++++++++------ doc/md/tutorial/helm-values.mdx | 28 ++++++++++++++++++---------- doc/md/tutorial/kustomize.mdx | 31 ++++++++++++++++++++----------- 4 files changed, 62 insertions(+), 30 deletions(-) diff --git a/doc/md/tutorial/cue.mdx b/doc/md/tutorial/cue.mdx index ad7819b2..bc9da32c 100644 --- a/doc/md/tutorial/cue.mdx +++ b/doc/md/tutorial/cue.mdx @@ -43,7 +43,9 @@ add the following CUE configuration to it. ```bash mkdir -p components/podinfo -touch components/podinfo/podinfo.cue +``` +```bash +cat < components/podinfo/podinfo.cue ``` ```cue showLineNumbers package holos @@ -66,11 +68,14 @@ Component: #Helm & { } } ``` +```bash +EOF +``` Integrate the component with the platform. ```bash -touch platform/podinfo.cue +cat < platform/podinfo.cue ``` ```cue showLineNumbers package holos @@ -80,6 +85,9 @@ Platform: Components: podinfo: { path: "components/podinfo" } ``` +```bash +EOF +``` Render the platform. @@ -113,7 +121,7 @@ component kind. This field is a convenient wrapper around the core [BuildPlan] Create the mixins.cue file. ```bash -touch components/podinfo/mixins.cue +cat < components/podinfo/mixins.cue ``` ```cue showLineNumbers package holos @@ -142,6 +150,9 @@ Component: { } } ``` +```bash +EOF +``` :::important Holos uses CUE to validate mixed in resources against a schema. The `Resources` diff --git a/doc/md/tutorial/hello-holos.mdx b/doc/md/tutorial/hello-holos.mdx index a5c27125..b9484cad 100644 --- a/doc/md/tutorial/hello-holos.mdx +++ b/doc/md/tutorial/hello-holos.mdx @@ -111,7 +111,9 @@ and then add the following CUE configuration to it. ```bash mkdir -p components/podinfo -touch components/podinfo/podinfo.cue +``` +```bash +cat < components/podinfo/podinfo.cue ``` ```cue showLineNumbers package holos @@ -138,6 +140,9 @@ HelmChart: #Helm & { } } ``` +```bash +EOF +``` :::important CUE loads all of `*.cue` files in the component directory to define component, @@ -155,10 +160,8 @@ platform root directory. In this example, `#Helm` on line 6 is defined in Integrate the `podinfo` component into the platform by creating a new CUE file in the `platform` directory with the following content. - - ```bash -touch platform/podinfo.cue +cat < platform/podinfo.cue ``` ```cue showLineNumbers package holos @@ -170,8 +173,9 @@ Platform: Components: podinfo: { parameters: greeting: "Hello Holos!" } ``` - - +```bash +EOF +``` :::tip Component parameters may have any name as long as they don't start with diff --git a/doc/md/tutorial/helm-values.mdx b/doc/md/tutorial/helm-values.mdx index 3e143ee1..e9ac5237 100644 --- a/doc/md/tutorial/helm-values.mdx +++ b/doc/md/tutorial/helm-values.mdx @@ -59,14 +59,12 @@ the following file contents. ```bash mkdir -p components/prometheus components/blackbox -touch components/prometheus/prometheus.cue -touch components/blackbox/blackbox.cue ``` -```txt -components/prometheus/prometheus.cue +```bash +cat < components/prometheus/prometheus.cue ``` ```cue showLineNumbers package holos @@ -84,11 +82,14 @@ Helm: #Helm & { } } } +``` +```bash +EOF ``` -```txt -components/blackbox/blackbox.cue +```bash +cat < components/blackbox/blackbox.cue ``` ```cue showLineNumbers package holos @@ -106,6 +107,9 @@ Helm: #Helm & { } } } +``` +```bash +EOF ``` @@ -116,9 +120,8 @@ Integrate the components with the platform by adding the following file to the platform directory. ```bash -touch platform/prometheus.cue +cat < platform/prometheus.cue ``` - ```cue showLineNumbers package holos @@ -133,6 +136,9 @@ Platform: Components: { } } ``` +```bash +EOF +``` Render the platform. @@ -243,9 +249,8 @@ use. We add this configuration to the `components` directory so it's in scope for all components. ```bash -touch components/blackbox.cue +cat < components/blackbox.cue ``` - ```cue showLineNumbers package holos @@ -263,6 +268,9 @@ Blackbox: #Blackbox & { port: 9115 } ``` +```bash +EOF +``` :::important 1. CUE loads and unifies all `*.cue` files from the root directory containing diff --git a/doc/md/tutorial/kustomize.mdx b/doc/md/tutorial/kustomize.mdx index d6efbe51..ed5d3aa3 100644 --- a/doc/md/tutorial/kustomize.mdx +++ b/doc/md/tutorial/kustomize.mdx @@ -61,11 +61,12 @@ Create the `httpbin` component directory and add the `httpbin.cue` and ```bash mkdir -p components/httpbin -touch components/httpbin/httpbin.cue -touch components/httpbin/httpbin.yaml ``` +```bash +cat < components/httpbin/httpbin.cue +``` ```cue showLineNumbers package holos @@ -97,9 +98,15 @@ Kustomize: #Kustomize & { } } } +``` +```bash +EOF ``` +```bash +cat < components/httpbin/httpbin.yaml +``` ```yaml showLineNumbers # https://github.com/mccutchen/go-httpbin/blob/v2.15.0/kustomize/resources.yaml apiVersion: apps/v1 @@ -137,6 +144,9 @@ spec: protocol: TCP name: http appProtocol: http +``` +```bash +EOF ``` @@ -150,9 +160,8 @@ Integrate `httpbin` with the platform by adding the following file to the platform directory. ```bash -touch platform/httpbin.cue +cat < platform/httpbin.cue ``` - ```cue showLineNumbers package holos @@ -163,6 +172,9 @@ Platform: Components: { } } ``` +```bash +EOF +``` Render the platform. @@ -275,13 +287,9 @@ makes this easier with CUE. We don't need to edit any yaml files. Add a new `patches.cue` file to the `httpbin` component with the following content. - - ```bash -touch components/httpbin/patches.cue +cat < components/httpbin/patches.cue ``` - - ```cue showLineNumbers package holos @@ -300,8 +308,9 @@ Kustomize: KustomizeConfig: Kustomization: _patches: { } } ``` - - +```bash +EOF +``` :::note We use a hidden `_patches` field to easily unify data into a struct, then