fix: consider base directory in heroku bp

This commit is contained in:
Andras Bacsai
2022-09-25 07:47:37 +00:00
parent 2d8888ae9b
commit 17f82109b6

View File

@@ -2,13 +2,12 @@ import { executeDockerCmd, prisma } from "../common"
import { saveBuildLog } from "./common"; import { saveBuildLog } from "./common";
export default async function (data: any): Promise<void> { export default async function (data: any): Promise<void> {
const { buildId, applicationId, tag, dockerId, debug, workdir } = data const { buildId, applicationId, tag, dockerId, debug, workdir, baseDirectory } = data
try { try {
await saveBuildLog({ line: `Building image started.`, buildId, applicationId }); await saveBuildLog({ line: `Building image started.`, buildId, applicationId });
const { stdout } = await executeDockerCmd({ const { stdout } = await executeDockerCmd({
dockerId, dockerId,
command: `pack build -p ${workdir} ${applicationId}:${tag} --builder heroku/buildpacks:20` command: `pack build -p ${workdir}${baseDirectory} ${applicationId}:${tag} --builder heroku/buildpacks:20`
}) })
if (debug) { if (debug) {
const array = stdout.split('\n') const array = stdout.split('\n')