Skip to content

Commit

Permalink
docs: Used stderr in get started guide snippets (#5094)
Browse files Browse the repository at this point in the history
* docs: Used stderr in get started guide snippets

---------

Signed-off-by: Vikram Vaswani <vikram@dagger.io>
Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>
Co-authored-by: Helder Correia <174525+helderco@users.noreply.github.com>
  • Loading branch information
vikram-dagger and helderco committed May 5, 2023
1 parent f98a2e9 commit f10be34
Show file tree
Hide file tree
Showing 48 changed files with 49 additions and 48 deletions.
2 changes: 1 addition & 1 deletion docs/current/guides/snippets/aws-cdk-ecs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func main() {
ctx := context.Background()

// initialize Dagger client
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/current/guides/snippets/github-google-cloud/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ connect(async (daggerClient) => {
// print ref
console.log(`Deployment for image ${gcrContainerPublishResponse} now available at ${gcrServiceUpdateResponse.uri}`)

}, {LogOutput: process.stdout})
}, {LogOutput: process.stderr})
2 changes: 1 addition & 1 deletion docs/current/guides/snippets/github-google-cloud/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const GCR_PUBLISH_ADDRESS = "gcr.io/PROJECT/myapp"
func main() {
// create Dagger client
ctx := context.Background()
daggerClient, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
daggerClient, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/current/guides/snippets/gitlab-google-cloud/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ connect(async (daggerClient) => {
// print ref
console.log(`Deployment for image ${gcrContainerPublishResponse} now available at ${gcrServiceUpdateResponse.uri}`)

}, {LogOutput: process.stdout})
}, {LogOutput: process.stderr})
2 changes: 1 addition & 1 deletion docs/current/guides/snippets/gitlab-google-cloud/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const GCR_PUBLISH_ADDRESS = "gcr.io/PROJECT/myapp"
func main() {
// create Dagger client
ctx := context.Background()
daggerClient, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
daggerClient, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
panic(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func architectureOf(platform dagger.Platform) string {

func main() {
ctx := context.Background()
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
panic(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const imageRepo = "localhost/testrepo:latest"

func main() {
ctx := context.Background()
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
panic(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func main() {
ctx := context.Background()
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
panic(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var platforms = []dagger.Platform{

func main() {
ctx := context.Background()
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/current/guides/snippets/replace-dockerfile/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ connect(async (client) => {

console.log(`Published to ${addr}`)

}, { LogOutput: process.stdout })
}, { LogOutput: process.stderr })


function setDependencies(container) {
Expand Down
2 changes: 1 addition & 1 deletion docs/current/guides/snippets/replace-dockerfile/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func main() {
ctx := context.Background()

// create a Dagger client
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
panic(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ connect(async (client: Client) => {

console.log(val)

}, { LogOutput: process.stdout })
}, { LogOutput: process.stderr })
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ connect(

console.log(val);
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
);
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ connect(
val = await httpSrv.endpoint({ scheme: "http" });
console.log(val);
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
);
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ connect(
console.log(val);

},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
);
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ connect(

console.log(val);
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
);
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ connect(
const getter = await redisCLI.withExec(['get', 'foo']).stdout();
console.log(getter);
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
);
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ connect(
console.log(val);

},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
);
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ connect(
.stdout();
console.log(val);
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
);
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ connect(
.stdout();
console.log(val);
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
);
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ connect(
.hostname()
console.log(val);
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
);
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ connect(async (client) => {
.publish('ttl.sh/hello-dagger-' + Math.floor(Math.random() * 10000000))
console.log(`Published image to: ${imageRef}`)

}, { LogOutput: process.stdout })
}, { LogOutput: process.stderr })
2 changes: 1 addition & 1 deletion docs/current/quickstart/snippets/build-dockerfile/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
ctx := context.Background()

// initialize Dagger client
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/current/quickstart/snippets/build-multi/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ connect(async (client) => {
.publish('ttl.sh/hello-dagger-' + Math.floor(Math.random() * 10000000))
console.log(`Published image to: ${imageRef}`)

}, { LogOutput: process.stdout })
}, { LogOutput: process.stderr })
2 changes: 1 addition & 1 deletion docs/current/quickstart/snippets/build-multi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
ctx := context.Background()

// initialize Dagger client
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))

if err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion docs/current/quickstart/snippets/build/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ connect(async (client) => {

console.log("build dir contents:\n", e)

}, { LogOutput: process.stdout })
}, { LogOutput: process.stderr })
2 changes: 1 addition & 1 deletion docs/current/quickstart/snippets/build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func main() {
ctx := context.Background()

// initialize Dagger client
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))

if err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion docs/current/quickstart/snippets/caching/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ connect(async (client) => {
.publish('ttl.sh/hello-dagger-' + Math.floor(Math.random() * 10000000))
console.log(`Published image to: ${imageRef}`)

}, { LogOutput: process.stdout })
}, { LogOutput: process.stderr })
2 changes: 1 addition & 1 deletion docs/current/quickstart/snippets/caching/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
ctx := context.Background()

// initialize Dagger client
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))

if err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion docs/current/quickstart/snippets/hello/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ connect(async (client) => {

// print output
console.log("Hello from Dagger and Node " + version)
}, { LogOutput: process.stdout })
}, { LogOutput: process.stderr })
2 changes: 1 addition & 1 deletion docs/current/quickstart/snippets/hello/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func main() {
ctx := context.Background()

// initialize Dagger client
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/current/quickstart/snippets/publish/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ connect(async (client) => {
console.log(`Published image to: ${imageRef}`)
// highlight-end

}, { LogOutput: process.stdout })
}, { LogOutput: process.stderr })
2 changes: 1 addition & 1 deletion docs/current/quickstart/snippets/publish/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
ctx := context.Background()

// initialize Dagger client
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))

if err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion docs/current/quickstart/snippets/test/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ connect(async (client) => {
.stderr()
console.log(out)

}, { LogOutput: process.stdout })
}, { LogOutput: process.stderr })
2 changes: 1 addition & 1 deletion docs/current/quickstart/snippets/test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func main() {
ctx := context.Background()

// initialize Dagger client
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
panic(err)
}
Expand Down
3 changes: 2 additions & 1 deletion docs/current/sdk/go/snippets/get-started/step2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"
"fmt"
"os"

"dagger.io/dagger"
)
Expand All @@ -17,7 +18,7 @@ func build(ctx context.Context) error {
fmt.Println("Building with Dagger")

// initialize Dagger client
client, err := dagger.Connect(ctx)
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion docs/current/sdk/go/snippets/get-started/step4/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func build(ctx context.Context) error {

// highlight-start
// initialize Dagger client
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion docs/current/sdk/go/snippets/get-started/step5a/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func build(ctx context.Context) error {
// highlight-end

// initialize Dagger client
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion docs/current/sdk/go/snippets/get-started/step5b/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func build(ctx context.Context) error {
// highlight-end

// initialize Dagger client
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr))
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
// print output
console.log("Hello from Dagger and Node " + version)
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
)
})()
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ connect(
// print output
console.log("Hello from Dagger and Node " + version)
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ connect(
// print output
console.log("Hello from Dagger and Node " + version)
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
)
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
.export("./build")
// highlight-end
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
)
})()
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ connect(
.export("./build")
// highlight-end
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ connect(
.export("./build")
// highlight-end
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
)
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
}
// highlight-end
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
)
})()
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ connect(
}
// highlight-end
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
)
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ connect(
}
// highlight-end
},
{ LogOutput: process.stdout }
{ LogOutput: process.stderr }
)

0 comments on commit f10be34

Please sign in to comment.