Merge pull request #1679 from jeskosda/feat/buildImagePatch

fix(build-imgae): get package name from env
This commit is contained in:
Patrik Oldsberg
2020-07-17 17:36:12 +02:00
committed by GitHub
@@ -19,8 +19,12 @@ import { createDistWorkspace } from '../../lib/packager';
import { paths } from '../../lib/paths';
import { run } from '../../lib/run';
const PKG_PATH = 'package.json';
export default async (imageTag: string) => {
const tempDistWorkspace = await createDistWorkspace(['example-backend'], {
const pkgPath = paths.resolveTarget(PKG_PATH);
const pkg = await fs.readJson(pkgPath);
const tempDistWorkspace = await createDistWorkspace([pkg.name], {
files: [
'package.json',
'yarn.lock',
@@ -28,7 +32,6 @@ export default async (imageTag: string) => {
{ src: paths.resolveTarget('Dockerfile'), dest: 'Dockerfile' },
],
});
console.log(`Dist workspace ready at ${tempDistWorkspace}`);
await run('docker', ['build', '.', '-t', imageTag], {