Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it compatible with Dagger Zenith #6

Merged
merged 5 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.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.8.1 sh
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.8 sh
sudo mv bin/dagger /usr/local/bin
dagger version
- name: Run Dagger Pipelines
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ 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.8.1 sh
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.8 sh
sudo mv bin/dagger /usr/local/bin
dagger version
- name: Run Dagger Pipelines
run: dagger run deno run -A ../src/dagger/runner.ts
run: |
rm ../deno.lockc
dagger run deno run -A ../src/dagger/runner.ts
working-directory: example
env:
SPIN_AUTH_TOKEN: ${{ secrets.SPIN_AUTH_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/zenith.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Do not edit this file directly. It is generated by https://deno.land/x/fluent_github_actions

name: Zenith Example
on:
push:
branches:
- zenith

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Dagger Zenith
run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.8 sh
sudo mv bin/dagger /usr/local/bin
dagger version
- name: Setup Spin Auth Token
run: |
sed -i "s/SPIN_AUTH_TOKEN/$SPIN_AUTH_TOKEN/g" example/deploy.gql
env:
SPIN_AUTH_TOKEN: ${{ secrets.SPIN_AUTH_TOKEN }}
- name: Run Dagger Pipelines
run: |
dagger query --doc build.gql
dagger query --doc deploy.gql
working-directory: example
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,24 @@ fluentci run spin_pipeline
| build | Build your Spin application (Only Rust is supported at the moment). |
| deploy | Deploy your Spin application to Fermyon Platform. |

```graphql
build(src: String!): String

deploy(
authToken: String!,
cacheKey: String!,
cachePath: String!,
src: String!
): String

```
## Programmatic usage

You can also use this pipeline programmatically:

```typescript
import Client, { connect } from "https://sdk.fluentci.io/v0.1.9/mod.ts";
import { build, deploy } from "https://pkg.fluentci.io/spin_pipeline@v0.5.2/mod.ts";

function pipeline(src = ".") {
connect(async (client: Client) => {
await build(client, src);
await deploy(client, src);
});
}

pipeline();
import { build, deploy } from "https://pkg.fluentci.io/spin_pipeline@v0.6.0/mod.ts";

await build();
await deploy();
```
13 changes: 3 additions & 10 deletions ci.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import Client, { connect } from "https://sdk.fluentci.io/v0.1.9/mod.ts";
import {
build,
deploy,
} from "https://pkg.fluentci.io/spin_pipeline@v0.5.2/mod.ts";
} from "https://pkg.fluentci.io/spin_pipeline@v0.6.0/mod.ts";

function pipeline(src = ".") {
connect(async (client: Client) => {
await build(client, src);
await deploy(client, src);
});
}

pipeline();
await build();
await deploy();
5 changes: 5 additions & 0 deletions dagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"root": "",
"name": "spin",
"sdkRuntime": "tsiry/dagger-sdk-deno"
}
24 changes: 19 additions & 5 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,29 @@
"tasks": {
"esm:add": "deno run -A https://esm.sh/v128 add",
"esm:update": "deno run -A https://esm.sh/v128 update",
"esm:remove": "deno run -A https://esm.sh/v128 remove"
"esm:remove": "deno run -A https://esm.sh/v128 remove",
"schema": "deno run -A src/dagger/schema.ts",
"clean": "rm -rf gen schema.graphql"
},
"fmt": {
"exclude": ["example/", ".fluentci/"]
"exclude": [
"example/",
".fluentci/",
"gen/"
]
},
"lint": {
"exclude": ["example/", ".fluentci/"]
"exclude": [
"example/",
".fluentci/",
"gen/"
]
},
"test": {
"exclude": ["example/", ".fluentci/"]
"exclude": [
"example/",
".fluentci/",
"gen/"
]
}
}
}
172 changes: 119 additions & 53 deletions deno.lock

Large diffs are not rendered by default.

26 changes: 23 additions & 3 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
export { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts";
import Client from "https://sdk.fluentci.io/v0.1.9/mod.ts";
import Client from "https://sdk.fluentci.io/z1/mod.ts";
export default Client;

export { connect, uploadContext } from "https://sdk.fluentci.io/v0.1.9/mod.ts";
export {
connect,
uploadContext,
CacheSharingMode,
} from "https://sdk.fluentci.io/z1/mod.ts";
export { brightGreen } from "https://deno.land/std@0.191.0/fmt/colors.ts";
export { withDevbox } from "https://nix.fluentci.io/v0.5.1/src/dagger/steps.ts";
export { withDevbox } from "https://nix.fluentci.io/zenith/src/dagger/steps.ts";
export { stringifyTree } from "https://esm.sh/stringify-tree@1.1.1";
import gql from "https://esm.sh/graphql-tag@2.12.6";
export { gql };

export {
arg,
queryType,
stringArg,
intArg,
nonNull,
makeSchema,
} from "npm:nexus";
export {
dirname,
join,
resolve,
} from "https://deno.land/std@0.203.0/path/mod.ts";

export * as FluentGitlabCI from "https://deno.land/x/fluent_gitlab_ci@v0.4.2/mod.ts";
export * as FluentGithubActions from "https://deno.land/x/fluent_github_actions@v0.2.1/mod.ts";
Expand Down
25 changes: 0 additions & 25 deletions example/.fluentci/.fluentci/.devcontainer/devcontainer.json

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions example/.fluentci/.fluentci/.fluentci/.github/workflows/ci.yml

This file was deleted.

3 changes: 0 additions & 3 deletions example/.fluentci/.fluentci/.fluentci/.vscode/settings.json

This file was deleted.

Loading
Loading