From 325c8439240c871decd0a1d4da7ab9ddc9208024 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Wed, 16 Jun 2021 15:31:31 +0000 Subject: [PATCH] Docs: 102: move cue package to a sub-directory Signed-off-by: Solomon Hykes --- docs/learn/102-dev.md | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/docs/learn/102-dev.md b/docs/learn/102-dev.md index 3bb31336..1f03eca3 100644 --- a/docs/learn/102-dev.md +++ b/docs/learn/102-dev.md @@ -113,10 +113,10 @@ See the [Cue documentation](https://cuelang.org/docs/concepts/packages/#files-be We will call our package `multibucket` because it sounds badass and vaguely explains what it does. But you can call your packages anything you want. -Let's layout the structure of our package by creating all the files in advance: +Let's create a new directory for our Cue package: ```shell -touch multibucket-source.cue multibucket-yarn.cue multibucket-netlify.cue +mkdir multibucket ``` ### Component 1: app source code @@ -128,9 +128,9 @@ In Dagger terms, this component has 2 important properties: 1. It is an *artifact*: something that can be represented as a directory. 2. It is an *input*: something that is provided by the end user. -Let's write the corresponding Cue code to `multibucket-source.cue`: +Let's write the corresponding Cue code to a new file in our package: -```cue title="~/examples/todoapp/multibucket-source.cue" +```cue title="todoapp/multibucket/source.cue" package multibucket import ( @@ -145,11 +145,9 @@ This defines a component at the key `src`, of type `dagger.#Artifact`, annotated ### Component 2: yarn package -The second component of our plan is the Yarn package built from the source code. +The second component of our plan is the Yarn package built from the app source code: -Let's write it to `multibucket-yarn.cue`: - -```cue title="~/examples/todoapp/multibucket-yarn.cue" +```cue title="todoapp/multibucket/yarn.cue" package multibucket import ( @@ -176,11 +174,9 @@ Let's break it down: ### Component 4: deploy to Netlify -The third component of our plan is the Netlify site to which the app will be deployed. +The third component of our plan is the Netlify site to which the app will be deployed: -Let's write it to `multibucket-netlify.cue`: - -```cue title="~/examples/todoapp/multibucket-netlify.cue" +```cue title="todoapp/multibucket/netlify.cue" package multibucket import ( @@ -228,7 +224,7 @@ dagger new 'multibucket' Now let's configure the new environment to use our package as its plan: ```shell -cp multibucket-*.cue .dagger/env/multibucket/plan/ +cp multibucket/*.cue .dagger/env/multibucket/plan/ ``` Note: you need to copy the files from your package into the environment, as shown above.