From 91ad12bff1240f29ffa971d25325905d5b7b8410 Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Tue, 5 Oct 2021 18:59:34 -0700 Subject: [PATCH] docs: added missing dagger init Signed-off-by: Sam Alba --- docs/learn/1003-get-started.md | 1 + docs/learn/1004-first-env.md | 2 +- docs/learn/1006-google-cloud-run.md | 9 +++++++- docs/learn/1007-kubernetes.md | 23 ++++++++++++++++++- docs/learn/1008-aws-cloudformation.md | 8 ++++++- .../getting-started/plans/local/local.cue | 2 +- 6 files changed, 40 insertions(+), 5 deletions(-) diff --git a/docs/learn/1003-get-started.md b/docs/learn/1003-get-started.md index 6b0208b1..f30f505d 100644 --- a/docs/learn/1003-get-started.md +++ b/docs/learn/1003-get-started.md @@ -170,6 +170,7 @@ push.ref "localhost:5000/todoapp:latest@sha256:" Image ref push.digest "sha256:" Image digest run.ref "localhost:5000/todoapp:latest@sha256:" Image reference (e.g: nginx:alpine) run.run.env.IMAGE_REF "localhost:5000/todoapp:latest@sha256:" - +appURL "http://localhost:8080/" Application URL ``` Congratulations! You’ve deployed your first Dagger plan! You can now [view the todo app](http://localhost:8080) in your browser! diff --git a/docs/learn/1004-first-env.md b/docs/learn/1004-first-env.md index 9b439d8f..dcdc85d0 100644 --- a/docs/learn/1004-first-env.md +++ b/docs/learn/1004-first-env.md @@ -92,7 +92,7 @@ Otherwise, don't worry: a Cue module is simply a directory with one or more Cue This guide will use the same directory as the root of the Dagger project and the Cue module, but you can create your Cue module anywhere inside the Dagger project. In general, you won't have to worry about it at all. You will initialize a dagger project with the following command. ```shell -dagger init # Optional, already present in `todoapp` +dagger init ``` > In our case, `todoapp` already contains a `.dagger` directory, so this step is optional. diff --git a/docs/learn/1006-google-cloud-run.md b/docs/learn/1006-google-cloud-run.md index beec5f1e..da473cc5 100644 --- a/docs/learn/1006-google-cloud-run.md +++ b/docs/learn/1006-google-cloud-run.md @@ -36,13 +36,20 @@ mkdir gcpcloudrun ### Create a basic plan ```cue file=./tests/gcpcloudrun/source.cue title="todoapp/cue.mod/gcpcloudrun/source.cue" + ``` ## Set up the environment ### Create a new environment -Now that your Cue package is ready, let's create an environment to run it: +Let's create a project: + +```shell +dagger init +``` + +Let's create an environment to run it: ```shell dagger new 'gcpcloudrun' -p ./gcpcloudrun diff --git a/docs/learn/1007-kubernetes.md b/docs/learn/1007-kubernetes.md index c55dc680..5a1774bb 100644 --- a/docs/learn/1007-kubernetes.md +++ b/docs/learn/1007-kubernetes.md @@ -151,6 +151,7 @@ kubectl delete -f k8s/ Create a file named `todoapp.cue` and add the following configuration to it. ```cue file=tests/kube-kind/basic/todoapp.cue title="todoapp/kube/todoapp.cue" + ``` This defines a `todoApp` variable containing the Kubernetes objects used to create a todoapp deployment. It also @@ -169,6 +170,7 @@ The following `config.cue` defines: - `kubeconfig` a generic value created to embed this string `kubeconfig` value ```cue file=tests/kube-kind/config.cue title="todoapp/kube/config.cue" + ``` @@ -183,6 +185,7 @@ The below `config.cue` defines: using `alpha.dagger.io/gcp/gke` ```cue file=tests/kube-gcp/basic/config.cue title="todoapp/kube/config.cue" + ``` @@ -197,6 +200,7 @@ The below `config.cue` defines: using `alpha.dagger.io/aws/eks` ```cue file=tests/kube-aws/basic/config.cue title="todoapp/kube/config.cue" + ``` @@ -207,7 +211,13 @@ The below `config.cue` defines: #### Create a new environment -Now that your Cue package is ready, let's create an environment to run it: +Let's create a project: + +```shell +dagger init +``` + +Let's create an environment to run it: ```shell dagger new 'kube' -p kube @@ -390,6 +400,7 @@ Let's see how to deploy an image locally and push it to the local cluster - `kustomization`, apply kustomization to image ```cue file=tests/kube-kind/deployment/todoapp.cue title="todoapp/kube/todoapp.cue" + ``` @@ -406,6 +417,7 @@ The two files have to be edited to do so. - definition of a new `gcrCreds` value that contains ecr credentials for remote image push to GCR ```cue file=tests/kube-gcp/deployment/config.cue title="todoapp/kube/config.cue" + ``` `kube/todoapp.cue`, on the other hand, faces these changes: @@ -417,6 +429,7 @@ The two files have to be edited to do so. - `kustomization`, apply kustomization to image ```cue file=tests/kube-gcp/deployment/todoapp.cue title="todoapp/kube/todoapp.cue" + ``` @@ -432,6 +445,7 @@ The two files have to be edited to do so. - definition of a new `ecrCreds` value that contains ecr credentials for remote image push to ECR ```cue file=tests/kube-aws/deployment/config.cue title="todoapp/kube/config.cue" + ``` `kube/todoapp.cue`, on the other hand, faces these changes: @@ -443,6 +457,7 @@ The two files have to be edited to do so. - `kustomization`, apply kustomization to image ```cue file=tests/kube-aws/deployment/todoapp.cue title="todoapp/kube/todoapp.cue" + ``` @@ -542,11 +557,13 @@ repetition. Let's define a re-usable `#Deployment` definition in `kube/deployment.cue`. ```cue file=tests/kube-kind/cue-manifest/deployment.cue title="todoapp/kube/deployment.cue" + ``` Indeed, let's also define a re-usable `#Service` definition in `kube/service.cue`. ```cue file=tests/kube-kind/cue-manifest/service.cue title="todoapp/kube/service.cue" + ``` ### Generate Kubernetes manifest @@ -557,6 +574,7 @@ without having boilerplate nor repetition. Create a new definition named `#AppManifest` that will generate the YAML in `kube/manifest.cue`. ```cue file=tests/kube-kind/cue-manifest/manifest.cue title="todoapp/kube/manifest.cue" + ``` ### Update manifest @@ -580,18 +598,21 @@ values={[ ```cue file=tests/kube-kind/cue-manifest/todoapp.cue title="todoapp/kube/todoapp.cue" + ``` ```cue file=tests/kube-gcp/cue-manifest/todoapp.cue title="todoapp/kube/todoapp.cue" + ``` ```cue file=tests/kube-aws/cue-manifest/todoapp.cue title="todoapp/kube/todoapp.cue" + ``` diff --git a/docs/learn/1008-aws-cloudformation.md b/docs/learn/1008-aws-cloudformation.md index 27a14e53..b6106b7f 100644 --- a/docs/learn/1008-aws-cloudformation.md +++ b/docs/learn/1008-aws-cloudformation.md @@ -108,7 +108,13 @@ This defines: ##### 1. Create a new environment -Now that the Cue package is ready, let's create an environment to run it: +Let's create a project: + +```shell +dagger init +``` + +Let's create an environment to run it: ```shell dagger new 'cloudformation' -p ./cloudformation diff --git a/docs/learn/tests/getting-started/plans/local/local.cue b/docs/learn/tests/getting-started/plans/local/local.cue index d3e0609f..05d7c064 100644 --- a/docs/learn/tests/getting-started/plans/local/local.cue +++ b/docs/learn/tests/getting-started/plans/local/local.cue @@ -29,5 +29,5 @@ registry: docker.#Run & { // we defined in the previous file push: target: "localhost:5000/todoapp" -// output the application URL +// Application URL appURL: "http://localhost:8080/" & dagger.#Output