Skip to content

Commit

Permalink
Merge pull request #1 from fluent-ci-templates/chore/default-exports
Browse files Browse the repository at this point in the history
update default exports
  • Loading branch information
tsirysndr authored Sep 16, 2023
2 parents a81fbf2 + ec3142a commit 6ab4557
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 72 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ dagger run fluentci .
You can also use this pipeline programmatically:

```ts
import { Client, connect } from "https://esm.sh/@dagger.io/dagger@0.8.1";
import { Dagger } from "https://pkg.fluentci.io/atlas_pipeline/mod.ts";

const { migrate } = Dagger;
import Client, { connect } from "https://sdk.fluentci.io/v0.1.7/mod";
import { migrate } from "https://pkg.fluentci.io/atlas_pipeline@v0.2.0/mod.ts";

function pipeline(src = ".") {
connect(async (client: Client) => {
Expand Down
153 changes: 94 additions & 59 deletions deno.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion import_map.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"imports": {
"@dagger.io/dagger": "https://esm.sh/v128/*@dagger.io/dagger@0.6.3",
"@fluentci.io/dagger": "https://sdk.fluentci.io/v0.1.7/mod.ts",
"@dagger.io/dagger": "https://esm.sh/v128/*@dagger.io/dagger@0.8.4",
"graphql-tag": "https://esm.sh/v128/graphql-tag@2.12.6",
"graphql-request": "https://esm.sh/v128/graphql-request@6.1.0",
"fluent_gitlab_ci": "https://deno.land/x/fluent_gitlab_ci@v0.4.2/mod.ts",
"fluent_github_actions": "https://deno.land/x/fluent_github_actions@v0.2.1/mod.ts",
"fluent_circleci": "https://deno.land/x/fluent_circleci@v0.2.5/mod.ts",
Expand Down
4 changes: 1 addition & 3 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import * as Dagger from "./src/dagger/index.ts";

export { Dagger };
export * from "./src/dagger/index.ts";
4 changes: 3 additions & 1 deletion src/dagger/jobs.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import Client from "@dagger.io/dagger";
import Client from "@fluentci.io/dagger";

export enum Job {
migrate = "migrate",
dryRun = "dry_run",
}

export const exclude = [];

const DATABASE_URL = Deno.env.get("DATABASE_URL");
const DATABASE_DEV_URL =
Deno.env.get("DATABASE_DEV_URL") || "mysql://root:pass@mysqldev:3306/example";
Expand Down
9 changes: 6 additions & 3 deletions src/dagger/pipeline.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import Client, { connect } from "@dagger.io/dagger";
import Client, { connect, uploadContext } from "@fluentci.io/dagger";
import * as jobs from "./jobs.ts";

const { migrate, runnableJobs } = jobs;
const { migrate, runnableJobs, exclude } = jobs;

export default function pipeline(_src = ".", args: string[] = []) {
export default async function pipeline(src = ".", args: string[] = []) {
if (Deno.env.has("FLUENTCI_SESSION_ID")) {
await uploadContext(src, exclude);
}
connect(async (client: Client) => {
if (args.length > 0) {
await runSpecificJobs(client, args as jobs.Job[]);
Expand Down
2 changes: 1 addition & 1 deletion src/dagger/runner.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import pipeline from "./pipeline.ts";

pipeline(".", Deno.args);
await pipeline(".", Deno.args);

0 comments on commit 6ab4557

Please sign in to comment.