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

View File

@ -1,3 +1,6 @@
import * as plugins from "./npmdocker.plugins";
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 `
FROM ${optionsArg.baseImage}
RUN mkdir /workspace
WORKDIR /workspace
cmd[${commandString}];
`
}