Skip to content

Commit

Permalink
fix issue with dagger connect
Browse files Browse the repository at this point in the history
ci: fix zenith workflow

ci: fix zenith workflow
  • Loading branch information
tsirysndr committed Jan 30, 2024
1 parent 4c08187 commit a075fb9
Show file tree
Hide file tree
Showing 24 changed files with 6,698 additions and 5,330 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
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 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 @@ -9,15 +9,15 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
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: Setup Service Account
Expand Down
9 changes: 5 additions & 4 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 Pulumi Access Token
Expand All @@ -30,8 +30,9 @@ jobs:
working-directory: example
- name: Run Dagger Pipelines
run: |
dagger query --doc preview.gql
dagger query --doc up.gql
dagger call preview --src . --stack dev --token PULUMI_ACCESS_TOKEN --google-application-credentials ./fluentci-086b644d4c53.json
dagger call up --src . --stack dev --token PULUMI_ACCESS_TOKEN --google-application-credentials ./fluentci-086b644d4c53.json
working-directory: example
env:
GOOGLE_APPLICATION_CREDENTIALS: ./fluentci-086b644d4c53.json
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ up(
You can also use this pipeline programmatically:

```ts
import { preview, up } from "https://pkg.fluentci.io/[email protected].0/mod.ts";
import { preview, up } from "https://pkg.fluentci.io/[email protected].1/mod.ts";

await preview(
".",
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 {
preview,
up,
} from "https://pkg.fluentci.io/[email protected].0/mod.ts";
} from "https://pkg.fluentci.io/[email protected].1/mod.ts";

await preview();
await up();
3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"exclude": [
"example/",
".fluentci/",
"gen/"
"gen/",
"sdk/"
]
}
}
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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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 a075fb9

Please sign in to comment.