Skip to content

Commit

Permalink
Merge pull request #44 from syfxlin/develop
Browse files Browse the repository at this point in the history
fix(deploy): env not found
  • Loading branch information
syfxlin authored Jan 7, 2024
2 parents febf4cf + 2e2e243 commit 9527fdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export { fs, path, yaml, ignore, nunjucks };
export { osType } from "https://deno.land/[email protected]/path/_os.ts";
export { colors } from "https://deno.land/x/[email protected]/ansi/mod.ts";
export { datetime } from "https://deno.land/x/[email protected]/mod.ts";
export { loadSync } from "https://deno.land/[email protected]/dotenv/mod.ts";
export { load } from "https://deno.land/[email protected]/dotenv/mod.ts";
export { deepMerge } from "https://deno.land/[email protected]/collections/mod.ts";
export { Command, EnumType } from "https://deno.land/x/[email protected]/command/mod.ts";
export { Table } from "https://deno.land/x/[email protected]/table/mod.ts";
Expand Down
6 changes: 5 additions & 1 deletion src/modules/service/pack.context.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -69,6 +69,10 @@ export class PackContext<Config extends ServiceConfig = ServiceConfig> {
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) => {
Expand Down

0 comments on commit 9527fdc

Please sign in to comment.