Skip to content

Commit 88975dd

Browse files
committed
fix issue with dagger connect
1 parent b2c7a53 commit 88975dd

23 files changed

+6878
-5524
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@v2
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
1717
- name: Upload to Codecov

.github/workflows/example.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
run: deno install -A -r https://cli.fluentci.io -n fluentci
1818
- name: Setup Dagger
1919
run: |
20-
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.3 sh
20+
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.7 sh
2121
sudo mv bin/dagger /usr/local/bin
2222
dagger version
2323
- name: Setup Service Account

.github/workflows/zenith.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v2
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: Setup Service Account
@@ -22,7 +22,7 @@ jobs:
2222
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
2323
- name: Run Dagger Pipelines
2424
run: |
25-
dagger query --doc init.gql
26-
dagger query --doc validate.gql
27-
dagger query --doc plan.gql
25+
dagger call init --src . --tf-version 1.5.7 --google-application-credentials ./fluentci-086b644d4c53.json
26+
dagger call validate --src . --tf-version 1.5.7
27+
dagger call plan --src . --tf-version 1.5.7 --google-application-credentials ./fluentci-086b644d4c53.json
2828
working-directory: example

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ apply(
9898
You can also use this pipeline programmatically:
9999

100100
```ts
101-
import { init, validate, plan, apply } from "https://pkg.fluentci.io/[email protected].1/mod.ts";
101+
import { init, validate, plan, apply } from "https://pkg.fluentci.io/[email protected].2/mod.ts";
102102

103103
await init();
104104
await validate();

ci.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
validate,
44
plan,
55
apply,
6-
} from "https://pkg.fluentci.io/[email protected].1/mod.ts";
6+
} from "https://pkg.fluentci.io/[email protected].2/mod.ts";
77

88
await init();
99
await validate();

deps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
22

33
export type { DirectoryID, SecretID } from "./sdk/client.gen.ts";
4-
export { Directory, Secret, File, Container } from "./sdk/client.gen.ts";
4+
export { Directory, Secret, File, Container, dag } from "./sdk/client.gen.ts";
55
export { connect, uploadContext } from "https://sdk.fluentci.io/v0.3.0/mod.ts";
66
export { brightGreen } from "https://deno.land/[email protected]/fmt/colors.ts";
77
export { withDevbox } from "https://nix.fluentci.io/v0.5.3/src/dagger/steps.ts";

example/.fluentci/deps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
22

33
export type { DirectoryID, SecretID } from "./sdk/client.gen.ts";
4-
export { Directory, Secret, File, Container } from "./sdk/client.gen.ts";
4+
export { Directory, Secret, File, Container, dag } from "./sdk/client.gen.ts";
55
export { connect, uploadContext } from "https://sdk.fluentci.io/v0.3.0/mod.ts";
66
export { brightGreen } from "https://deno.land/[email protected]/fmt/colors.ts";
77
export { withDevbox } from "https://nix.fluentci.io/v0.5.3/src/dagger/steps.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)