From 475e47de09eb1293baf86b3d970aaac2d2c2f697 Mon Sep 17 00:00:00 2001 From: guillaume Date: Tue, 23 Nov 2021 19:26:02 +0100 Subject: [PATCH] Modify getting started doc to integrate http.#Wait, fix doc dependency issue Signed-off-by: guillaume --- .../tests/getting-started/plans/local/local.cue | 9 ++++++++- docs/learn/tests/getting-started/plans/todoapp.cue | 2 +- docs/reference/http.md | 12 ++++++++++++ stdlib/http/tests/http.cue | 4 ++-- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/docs/learn/tests/getting-started/plans/local/local.cue b/docs/learn/tests/getting-started/plans/local/local.cue index a9460987..63ed78d3 100644 --- a/docs/learn/tests/getting-started/plans/local/local.cue +++ b/docs/learn/tests/getting-started/plans/local/local.cue @@ -3,6 +3,7 @@ package todoapp import ( "alpha.dagger.io/dagger" "alpha.dagger.io/docker" + "alpha.dagger.io/http" ) // docker local socket @@ -24,10 +25,16 @@ registry: docker.#Run & { socket: dockerSocket } +// As we pushed the registry to our local docker +// we need to wait for the container to be up +wait: http.#Wait & { + url: "localhost:5042" +} + // push to our local registry // this concrete value satisfies the string constraint // we defined in the previous file -push: target: "localhost:5042/todoapp" +push: target: "\(wait.url)/todoapp" // Application URL appURL: "http://localhost:8080/" & dagger.#Output diff --git a/docs/learn/tests/getting-started/plans/todoapp.cue b/docs/learn/tests/getting-started/plans/todoapp.cue index 8fa8b0cd..e3812196 100644 --- a/docs/learn/tests/getting-started/plans/todoapp.cue +++ b/docs/learn/tests/getting-started/plans/todoapp.cue @@ -2,9 +2,9 @@ package todoapp import ( "alpha.dagger.io/dagger" - "alpha.dagger.io/os" "alpha.dagger.io/docker" "alpha.dagger.io/js/yarn" + "alpha.dagger.io/os" ) // Build the source code using Yarn diff --git a/docs/reference/http.md b/docs/reference/http.md index 71d6e0b9..41c83cd6 100644 --- a/docs/reference/http.md +++ b/docs/reference/http.md @@ -72,3 +72,15 @@ _No input._ | ------------- |:-------------: |:-------------: | |*statusCode* | `string` |- | |*body* | `string` |- | + +## http.#Wait + +URL listener Creates a dependency on URL + +### http.#Wait Inputs + +_No input._ + +### http.#Wait Outputs + +_No output._ diff --git a/stdlib/http/tests/http.cue b/stdlib/http/tests/http.cue index 01de831b..a512b633 100644 --- a/stdlib/http/tests/http.cue +++ b/stdlib/http/tests/http.cue @@ -18,12 +18,12 @@ TestRun: docker.#Run & { name: "daggerci-test-wait-\(TestSuffix.out)" ref: "nginx" socket: TestDockersocket - ports: ["8080:80"] + ports: ["8088:80"] } // Waits for TestRun to finish initializing Testhealth: #Wait & { - url: "http://localhost:8080/" + url: "http://localhost:8088/" } TestWait: query: os.#Container & {