improve path management

This commit is contained in:
Philipp Kunz 2016-07-19 02:03:54 +02:00
parent 8c5cf3485a
commit ddfd314a18
3 changed files with 9 additions and 1 deletions

View File

@ -26,6 +26,7 @@ let buildDockerFile = () => {
baseImage:config.baseImage, baseImage:config.baseImage,
command:config.command command:config.command
}); });
plugins.smartfile.memory.toFsSync(JSON.stringify(dockerfile),paths.dockerfile);
return done.promise return done.promise
}; };
@ -34,6 +35,8 @@ let buildDockerFile = () => {
*/ */
let buildDockerImage = () => { let buildDockerImage = () => {
let done = plugins.q.defer(); let done = plugins.q.defer();
plugins.shelljs(`docker build -f ${paths.dockerfile} -v ${paths.cwd}:/workdir ${paths.assets}`);
done.resolve();
return done.promise return done.promise
}; };

View File

@ -1,3 +1,6 @@
import * as plugins from "./npmdocker.plugins"; import * as plugins from "./npmdocker.plugins";
export let packageBase = plugins.path.join(__dirname,"../"); export let packageBase = plugins.path.join(__dirname,"../");
export let assets = plugins.path.join(packageBase,"assets/");
plugins.smartfile.fs.ensureDirSync(assets);
export let dockerfile = plugins.path.join(assets,"Dockerfile");

View File

@ -16,6 +16,8 @@ export let dockerfileSnippet = (optionsArg:IDockerfileSnippet):string => {
} }
return ` return `
FROM ${optionsArg.baseImage} FROM ${optionsArg.baseImage}
RUN mkdir /workspace
WORKDIR /workspace
cmd[${commandString}]; cmd[${commandString}];
` `
} }