From 7617c6f6aa92784a61a7aa14b593a99d9dc99d33 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Fri, 15 Sep 2023 04:43:42 +0000 Subject: [PATCH] update default exports --- README.md | 6 ++---- deno.lock | 10 +++++++++- import_map.json | 2 +- mod.ts | 4 +--- src/dagger/jobs.ts | 2 +- src/dagger/pipeline.ts | 9 ++++++--- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 861252d..176ad05 100644 --- a/README.md +++ b/README.md @@ -65,10 +65,8 @@ dagger run fluentci . You can also use this pipeline programmatically: ```ts -import Client, { connect } from "https://sdk.fluentci.io/v0.1.4/mod.ts"; -import { Dagger } from "https://pkg.fluentci.io/terraform_pipeline/mod.ts"; - -const { init, validate, plan, apply } = Dagger; +import Client, { connect } from "https://sdk.fluentci.io/v0.1.7/mod.ts"; +import { init, validate, plan, apply } from "https://pkg.fluentci.io/terraform_pipeline@v0.3.0/mod.ts"; function pipeline(src = ".") { connect(async (client: Client) => { diff --git a/deno.lock b/deno.lock index 41b2dad..4c7da3e 100644 --- a/deno.lock +++ b/deno.lock @@ -4,6 +4,9 @@ "https://cdn.jsdelivr.net/gh/tsirysndr/tar/deps.ts": "096395daebc7ed8a18f0484e4ffcc3a7f70e50946735f7df9611a7fcfd8272cc", "https://cdn.jsdelivr.net/gh/tsirysndr/tar/mod.ts": "e269d71c72ae68e82c1960e5db2a0c7419c97c9683ef717de0ab75d90f364713", "https://cdn.jsdelivr.net/gh/tsirysndr/tar/src/tar.ts": "8a2c1c4692cf92f70437509761dec291a660a85675602e4954de04e721d82ae4", + "https://cdn.jsdelivr.net/gh/tsirysndr/tar@v0.1.1/deps.ts": "096395daebc7ed8a18f0484e4ffcc3a7f70e50946735f7df9611a7fcfd8272cc", + "https://cdn.jsdelivr.net/gh/tsirysndr/tar@v0.1.1/mod.ts": "e269d71c72ae68e82c1960e5db2a0c7419c97c9683ef717de0ab75d90f364713", + "https://cdn.jsdelivr.net/gh/tsirysndr/tar@v0.1.1/src/tar.ts": "9b02eaaa784b225ad7a23d2769cd492adf113ea7c11c02e3646849e98f4ae43b", "https://deno.land/std@0.129.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", "https://deno.land/std@0.129.0/_util/os.ts": "49b92edea1e82ba295ec946de8ffd956ed123e2948d9bd1d3e901b04e4307617", "https://deno.land/std@0.129.0/archive/tar.ts": "35ea1baddec7988cc4034765a2cee7613bc8074bd40940d3f5e98f63070a716a", @@ -150,6 +153,11 @@ "https://sdk.fluentci.io/v0.1.4/src/client.ts": "f44b27ae573b09d85089ce4e5c9a01c95926058fb41d26de23f0f6f5412ecf89", "https://sdk.fluentci.io/v0.1.4/src/connect.ts": "ddd4cbac2069427ad3b9106459207d63d392640f3c669c45b87e5049711dd338", "https://sdk.fluentci.io/v0.1.4/src/context.ts": "7e0503a6711526a1d11ef24579b340b0ad08587af138a137cacb85f7fe4ebf3f", - "https://sdk.fluentci.io/v0.1.4/src/utils.ts": "df9a823be6e127feb3e2e4261f3c0b3b31da888ba2bfc4b8b841ae4c2fcd3373" + "https://sdk.fluentci.io/v0.1.4/src/utils.ts": "df9a823be6e127feb3e2e4261f3c0b3b31da888ba2bfc4b8b841ae4c2fcd3373", + "https://sdk.fluentci.io/v0.1.7/mod.ts": "d04d9358605b672fc877e7ae8eaaef228773819e9c46bf581dd4a351b887ab7e", + "https://sdk.fluentci.io/v0.1.7/src/client.ts": "f44b27ae573b09d85089ce4e5c9a01c95926058fb41d26de23f0f6f5412ecf89", + "https://sdk.fluentci.io/v0.1.7/src/connect.ts": "ddd4cbac2069427ad3b9106459207d63d392640f3c669c45b87e5049711dd338", + "https://sdk.fluentci.io/v0.1.7/src/context.ts": "8d743af8bf20889bba51275da2b164580a8f3442ab1a2679843b0447d0d90cfb", + "https://sdk.fluentci.io/v0.1.7/src/utils.ts": "df9a823be6e127feb3e2e4261f3c0b3b31da888ba2bfc4b8b841ae4c2fcd3373" } } diff --git a/import_map.json b/import_map.json index a902ba8..b5fb36e 100644 --- a/import_map.json +++ b/import_map.json @@ -1,6 +1,6 @@ { "imports": { - "@fluentci.io/dagger": "https://sdk.fluentci.io/v0.1.4/mod.ts", + "@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", diff --git a/mod.ts b/mod.ts index 2c3acca..fbc1f17 100644 --- a/mod.ts +++ b/mod.ts @@ -1,3 +1 @@ -import * as Dagger from "./src/dagger/index.ts"; - -export { Dagger }; +export * from "./src/dagger/index.ts"; diff --git a/src/dagger/jobs.ts b/src/dagger/jobs.ts index fd5450a..3229296 100644 --- a/src/dagger/jobs.ts +++ b/src/dagger/jobs.ts @@ -8,7 +8,7 @@ export enum Job { apply = "apply", } -const exclude = [".terraform", ".git", ".fluentci", "plan"]; +export const exclude = [".terraform", ".git", ".fluentci", "plan"]; const envs = filterObjectByPrefix(Deno.env.toObject(), ["TF_", "AWS_"]); diff --git a/src/dagger/pipeline.ts b/src/dagger/pipeline.ts index 4506e0d..c168e77 100644 --- a/src/dagger/pipeline.ts +++ b/src/dagger/pipeline.ts @@ -1,9 +1,12 @@ -import Client, { connect } from "@fluentci.io/dagger"; +import Client, { connect, uploadContext } from "@fluentci.io/dagger"; import * as jobs from "./jobs.ts"; -const { init, validate, plan, runnableJobs } = jobs; +const { init, validate, plan, 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[]);