Skip to content

Commit

Permalink
fix: issue where build dependencies couldn't be copied
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Apr 22, 2018
1 parent 26f38c7 commit d3a44cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export interface PluginContext extends PluginContextGuard, WrappedFromGarden {
setConfig: (key: string[], value: string) => Promise<void>
deleteConfig: (key: string[]) => Promise<DeleteConfigResult>

stageBuild: <T extends Module>(module: T) => Promise<void>
getStatus: () => Promise<ContextStatus>
deployServices: (
params: { names?: string[], force?: boolean, forceBuild?: boolean, logEntry?: LogEntry },
Expand Down Expand Up @@ -171,6 +172,10 @@ export function createPluginContext(garden: Garden): PluginContext {
return handler({ ...commonParams(handler), module, logEntry })
},

stageBuild: async <T extends Module>(module: T) => {
await garden.buildDir.syncDependencyProducts(ctx, module)
},

pushModule: async <T extends Module>(module: T, logEntry?: LogEntry) => {
const handler = garden.getModuleActionHandler("pushModule", module.type, dummyPushHandler)
return handler({ ...commonParams(handler), module, logEntry })
Expand Down
2 changes: 2 additions & 0 deletions src/tasks/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export class BuildTask<T extends Module> extends Task {

async process(): Promise<BuildResult> {
if (!this.force && (await this.ctx.getModuleBuildStatus(this.module)).ready) {
// this is necessary in case other modules depend on files from this one
await this.ctx.stageBuild(this.module)
return { fresh: false }
}

Expand Down

0 comments on commit d3a44cd

Please sign in to comment.