Skip to content

Commit

Permalink
fix issue with dagger connect
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Jan 30, 2024
1 parent 67cf08b commit 0cf5bb9
Show file tree
Hide file tree
Showing 25 changed files with 6,805 additions and 5,630 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup Fluent CI
uses: fluentci-io/setup-fluentci@v2
uses: fluentci-io/setup-fluentci@v3
- name: Run Dagger Pipelines
run: fluentci run deno_pipeline fmt lint test
- name: Upload coverage to Codecov
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
run: deno install -A -r https://cli.fluentci.io -n fluentci
- name: Setup Dagger
run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.3 sh
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.7 sh
sudo mv bin/dagger /usr/local/bin
dagger version
- name: Run Dagger Pipelines
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/zenith.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
- uses: actions/checkout@v2
- name: Setup Dagger Zenith
run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.3 sh
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.7 sh
sudo mv bin/dagger /usr/local/bin
dagger version
- name: Run Dagger Pipelines
run: |
dagger query --doc config.gql
dagger query --doc image.gql
dagger call config --src . --exit-code 0
dagger call image --src . --exit-code 0 --image snyk/snyk:alpine
working-directory: example
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ image(
You can also use this pipeline programmatically:

```ts
import { fs } from "https://pkg.fluentci.io/trivy_pipeline@v0.3.0/mod.ts";
import { fs } from "https://pkg.fluentci.io/trivy_pipeline@v0.3.1/mod.ts";

await fs(".");
```
2 changes: 1 addition & 1 deletion ci.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { fs } from "https://pkg.fluentci.io/trivy_pipeline@v0.3.0/mod.ts";
import { fs } from "https://pkg.fluentci.io/trivy_pipeline@v0.3.1/mod.ts";

await fs();
4 changes: 1 addition & 3 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
export { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts";
import { Client } from "./sdk/client.gen.ts";
export default Client;

export type { DirectoryID, SecretID } from "./sdk/client.gen.ts";
export { Directory, Secret, File } from "./sdk/client.gen.ts";
export { Directory, Secret, File, dag } from "./sdk/client.gen.ts";
export { connect, uploadContext } from "https://sdk.fluentci.io/v0.3.0/mod.ts";
export { brightGreen } from "https://deno.land/std@0.191.0/fmt/colors.ts";
export { withDevbox } from "https://nix.fluentci.io/v0.5.3/src/dagger/steps.ts";
Expand Down
4 changes: 1 addition & 3 deletions example/.fluentci/deps.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
export { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts";
import { Client } from "./sdk/client.gen.ts";
export default Client;

export type { DirectoryID, SecretID } from "./sdk/client.gen.ts";
export { Directory, Secret, File } from "./sdk/client.gen.ts";
export { Directory, Secret, File, dag } from "./sdk/client.gen.ts";
export { connect, uploadContext } from "https://sdk.fluentci.io/v0.3.0/mod.ts";
export { brightGreen } from "https://deno.land/std@0.191.0/fmt/colors.ts";
export { withDevbox } from "https://nix.fluentci.io/v0.5.3/src/dagger/steps.ts";
Expand Down
162 changes: 0 additions & 162 deletions example/.fluentci/gen/nexus.ts

This file was deleted.

11 changes: 0 additions & 11 deletions example/.fluentci/schema.graphql

This file was deleted.

30 changes: 30 additions & 0 deletions example/.fluentci/sdk/builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { createGQLClient } from "./client.ts";
import { Context } from "./context.ts";

/**
* @hidden
*
* Initialize a default client context from environment.
*/
export function initDefaultContext(): Context {
let ctx = new Context();

// Prefer DAGGER_SESSION_PORT if set
const daggerSessionPort = Deno.env.get("DAGGER_SESSION_PORT");
if (daggerSessionPort) {
const sessionToken = Deno.env.get("DAGGER_SESSION_TOKEN");
if (!sessionToken) {
throw new Error(
"DAGGER_SESSION_TOKEN must be set when using DAGGER_SESSION_PORT"
);
}

ctx = new Context({
client: createGQLClient(Number(daggerSessionPort), sessionToken),
});
} else {
throw new Error("DAGGER_SESSION_PORT must be set");
}

return ctx;
}
Loading

0 comments on commit 0cf5bb9

Please sign in to comment.