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 28, 2024
1 parent fb84fa5 commit 4c47b41
Show file tree
Hide file tree
Showing 23 changed files with 6,863 additions and 5,543 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: denoland/setup-deno@v1
with:
deno-version: v1.37
- name: Setup Fluent CI CLI
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
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
5 changes: 1 addition & 4 deletions .github/workflows/zenith.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ 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: |
sed -i 's/npm/${{ matrix.package_manager }}/g' test.gql
sed -i 's/npm/${{ matrix.package_manager }}/g' build.gql
sed -i 's/npm/${{ matrix.package_manager }}/g' run.gql
dagger query --doc test.gql
dagger query --doc build.gql
dagger query --doc run.gql
dagger call test --src . --package-manager ${{ matrix.package_manager }}
dagger call build --src . --package-manager ${{ matrix.package_manager }}
dagger call run --src . --task build --package-manager ${{ matrix.package_manager }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ dev(
You can also use this pipeline programmatically:

```ts
import { test, build } from "https://pkg.fluentci.io/nodejs_pipeline@v0.6.0/mod.ts";
import { test, build } from "https://pkg.fluentci.io/nodejs_pipeline@v0.6.1/mod.ts";

await test();
await build();
Expand Down
2 changes: 1 addition & 1 deletion ci.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
test,
build,
} from "https://pkg.fluentci.io/nodejs_pipeline@v0.6.0/mod.ts";
} from "https://pkg.fluentci.io/nodejs_pipeline@v0.6.1/mod.ts";

await test();
await build();
2 changes: 1 addition & 1 deletion deps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts";

export type { DirectoryID, SecretID } from "./sdk/client.gen.ts";
export { Directory, Secret, File, Container } from "./sdk/client.gen.ts";
export { Directory, Secret, File, Container, 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
2 changes: 1 addition & 1 deletion example/.fluentci/deps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts";

export type { DirectoryID, SecretID } from "./sdk/client.gen.ts";
export { Directory, Secret, File, Container } from "./sdk/client.gen.ts";
export { Directory, Secret, File, Container, 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
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 4c47b41

Please sign in to comment.