Skip to content

Commit 28ae80e

Browse files
committed
fix issue with dagger connect
1 parent dd3d323 commit 28ae80e

File tree

23 files changed

+6653
-5301
lines changed

23 files changed

+6653
-5301
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v3
1313
- name: Setup Fluent CI
14-
uses: fluentci-io/setup-fluentci@v2
14+
uses: fluentci-io/setup-fluentci@v3
1515
- name: Run Dagger Pipelines
1616
run: fluentci run deno_pipeline fmt lint test
1717
- name: Upload to Codecov

.github/workflows/example.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
run: deno install -A -r https://cli.fluentci.io -n fluentci
1616
- name: Setup Dagger
1717
run: |
18-
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.3 sh
18+
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.7 sh
1919
sudo mv bin/dagger /usr/local/bin
2020
dagger version
2121
- name: Run Dagger Pipelines

.github/workflows/zenith.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
tests:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
- name: Setup Dagger Zenith
1515
run: |
16-
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.3 sh
16+
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.7 sh
1717
sudo mv bin/dagger /usr/local/bin
1818
dagger version
1919
- name: Run Dagger Pipelines
2020
run: |
21-
dagger query --doc lint.gql
21+
dagger call lint --src .
2222
dagger call format --src .
2323
working-directory: example

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ dagger mod install github.com/fluent-ci-templates/buf-pipeline@mod
6868
You can also use this pipeline programmatically:
6969

7070
```ts
71-
import { lint, push } from "https://pkg.fluentci.io/[email protected].0/mod.ts";
71+
import { lint, push } from "https://pkg.fluentci.io/[email protected].1/mod.ts";
7272

7373
await lint(".");
7474
await push(".", Deno.env.get("BUF_TOKEN")!);

ci.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { lint, push } from "https://pkg.fluentci.io/[email protected].0/mod.ts";
1+
import { lint, push } from "https://pkg.fluentci.io/[email protected].1/mod.ts";
22

33
await lint();
44
await push();

deps.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
export { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
2-
import { Client } from "./sdk/client.gen.ts";
3-
export default Client;
42

5-
export { Directory, Container, Secret } from "./sdk/client.gen.ts";
3+
export { Directory, Container, Secret, dag } from "./sdk/client.gen.ts";
64
export type { DirectoryID, SecretID } from "./sdk/client.gen.ts";
75
export { connect, uploadContext } from "https://sdk.fluentci.io/v0.3.0/mod.ts";
86
export { brightGreen } from "https://deno.land/[email protected]/fmt/colors.ts";

example/.fluentci/deps.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
export { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
2-
import { Client } from "./sdk/client.gen.ts";
3-
export default Client;
42

5-
export { Directory, Container, Secret } from "./sdk/client.gen.ts";
3+
export { Directory, Container, Secret, dag } from "./sdk/client.gen.ts";
64
export type { DirectoryID, SecretID } from "./sdk/client.gen.ts";
75
export { connect, uploadContext } from "https://sdk.fluentci.io/v0.3.0/mod.ts";
86
export { brightGreen } from "https://deno.land/[email protected]/fmt/colors.ts";

example/.fluentci/sdk/builder.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { createGQLClient } from "./client.ts";
2+
import { Context } from "./context.ts";
3+
4+
/**
5+
* @hidden
6+
*
7+
* Initialize a default client context from environment.
8+
*/
9+
export function initDefaultContext(): Context {
10+
let ctx = new Context();
11+
12+
// Prefer DAGGER_SESSION_PORT if set
13+
const daggerSessionPort = Deno.env.get("DAGGER_SESSION_PORT");
14+
if (daggerSessionPort) {
15+
const sessionToken = Deno.env.get("DAGGER_SESSION_TOKEN");
16+
if (!sessionToken) {
17+
throw new Error(
18+
"DAGGER_SESSION_TOKEN must be set when using DAGGER_SESSION_PORT"
19+
);
20+
}
21+
22+
ctx = new Context({
23+
client: createGQLClient(Number(daggerSessionPort), sessionToken),
24+
});
25+
} else {
26+
throw new Error("DAGGER_SESSION_PORT must be set");
27+
}
28+
29+
return ctx;
30+
}

0 commit comments

Comments
 (0)