diff --git a/src/deps.ts b/src/deps.ts index 0833f87..60552ca 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -8,7 +8,7 @@ export { fs, path, yaml, ignore, nunjucks }; export { osType } from "https://deno.land/std@0.210.0/path/_os.ts"; export { colors } from "https://deno.land/x/cliffy@v0.25.7/ansi/mod.ts"; export { datetime } from "https://deno.land/x/ptera@v1.0.2/mod.ts"; -export { loadSync } from "https://deno.land/std@0.210.0/dotenv/mod.ts"; +export { load } from "https://deno.land/std@0.210.0/dotenv/mod.ts"; export { deepMerge } from "https://deno.land/std@0.210.0/collections/mod.ts"; export { Command, EnumType } from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts"; export { Table } from "https://deno.land/x/cliffy@v0.25.7/table/mod.ts"; diff --git a/src/modules/service/pack.context.ts b/src/modules/service/pack.context.ts index e5224e7..466b0d0 100644 --- a/src/modules/service/pack.context.ts +++ b/src/modules/service/pack.context.ts @@ -1,5 +1,5 @@ import { Depker } from "../../depker.ts"; -import { deepMerge, fs, ignore, nunjucks, osType, path, yaml } from "../../deps.ts"; +import { deepMerge, fs, ignore, load, nunjucks, osType, path, yaml } from "../../deps.ts"; import { BuildAtConfig, DeployAtConfig, Pack, ServiceConfig, StartAtConfig } from "./service.type.ts"; import { BuilderBuildOptions, ContainerCreateOptions } from "../../services/docker/types.ts"; import { ServiceModule } from "./service.module.ts"; @@ -69,6 +69,10 @@ export class PackContext { return !r || !ig.ignores(r); }, }); + const envs = await load({ examplePath: undefined }); + if (Object.keys(envs).length) { + config.secrets = { ...config.secrets, ...envs }; + } if (config.volumes) { for (const value of config.volumes) { value.hpath = depker.uti.replace(value.hpath, (key) => {