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 6b70677 commit c715bb7
Show file tree
Hide file tree
Showing 25 changed files with 6,789 additions and 5,433 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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
- name: Upload to Codecov
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: denolib/setup-deno@v2
with:
deno-version: v1.37
- name: Setup Fluent CI CLI
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
8 changes: 5 additions & 3 deletions .github/workflows/zenith.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- 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: Setup DATABASE_URL
Expand All @@ -23,5 +23,7 @@ jobs:
DATABASE_URL: mysql://root:pass@mysql:3306/example
- name: Run Dagger Pipelines
run: |
dagger query --doc migrate.gql
dagger call migrate --database-url DATABASE_URL
working-directory: example
env:
DATABASE_URL: mysql://root:pass@mysql:3306/example
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ migrate(
You can also use this pipeline programmatically:

```ts
import { migrate } from "https://pkg.fluentci.io/atlas_pipeline@v0.5.0/mod.ts";
import { migrate } from "https://pkg.fluentci.io/atlas_pipeline@v0.5.1/mod.ts";

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

await migrate();
5 changes: 1 addition & 4 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,10 +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 } from "./sdk/client.gen.ts";
export { connect, uploadContext } from "https://sdk.fluentci.io/v0.3.0/mod.ts";
export { Directory, Secret, dag } from "./sdk/client.gen.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";
export { stringifyTree } from "https://esm.sh/stringify-tree@1.1.1";
Expand Down
5 changes: 1 addition & 4 deletions example/.fluentci/deps.ts
Original file line number Diff line number Diff line change
@@ -1,10 +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 } from "./sdk/client.gen.ts";
export { connect, uploadContext } from "https://sdk.fluentci.io/v0.3.0/mod.ts";
export { Directory, Secret, dag } from "./sdk/client.gen.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";
export { stringifyTree } from "https://esm.sh/stringify-tree@1.1.1";
Expand Down
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 c715bb7

Please sign in to comment.