diff --git a/dist/index.js b/dist/index.js
index 43007c7..9052a77 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,8 +1,4 @@
"use strict";
-const plugins = require("./npmdocker.plugins");
-let config = plugins.npmextra.dataFor({
- toolName: "npmdocker",
- defaultSettings: {},
- cwd: ""
-});
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsTUFBWSxPQUFPLFdBQU0scUJBQXFCLENBQUMsQ0FBQTtBQUsvQyxJQUFJLE1BQU0sR0FBRyxPQUFPLENBQUMsUUFBUSxDQUFDLE9BQU8sQ0FBQztJQUNsQyxRQUFRLEVBQUMsV0FBVztJQUNwQixlQUFlLEVBQUUsRUFBRTtJQUNuQixHQUFHLEVBQUUsRUFBRTtDQUNWLENBQUMsQ0FBQyJ9
\ No newline at end of file
+const promisechain = require("./npmdocker.promisechain");
+promisechain.run();
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsTUFBWSxZQUFZLFdBQU0sMEJBQTBCLENBQUMsQ0FBQTtBQUV6RCxZQUFZLENBQUMsR0FBRyxFQUFFLENBQUMifQ==
\ No newline at end of file
diff --git a/dist/npmdocker.config.d.ts b/dist/npmdocker.config.d.ts
new file mode 100644
index 0000000..76d1519
--- /dev/null
+++ b/dist/npmdocker.config.d.ts
@@ -0,0 +1,3 @@
+///
+import * as plugins from "./npmdocker.plugins";
+export declare let run: () => plugins.q.Promise<{}>;
diff --git a/dist/npmdocker.config.js b/dist/npmdocker.config.js
new file mode 100644
index 0000000..97a309e
--- /dev/null
+++ b/dist/npmdocker.config.js
@@ -0,0 +1,13 @@
+"use strict";
+const plugins = require("./npmdocker.plugins");
+let config = plugins.npmextra.dataFor({
+ toolName: "npmdocker",
+ defaultSettings: {},
+ cwd: ""
+});
+exports.run = () => {
+ let done = plugins.q.defer();
+ done.resolve(config);
+ return done.promise;
+};
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZG9ja2VyLmNvbmZpZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWRvY2tlci5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE1BQVksT0FBTyxXQUFNLHFCQUFxQixDQUFDLENBQUE7QUFHL0MsSUFBSSxNQUFNLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxPQUFPLENBQUM7SUFDbEMsUUFBUSxFQUFDLFdBQVc7SUFDcEIsZUFBZSxFQUFFLEVBQUU7SUFDbkIsR0FBRyxFQUFFLEVBQUU7Q0FDVixDQUFDLENBQUM7QUFFUSxXQUFHLEdBQUc7SUFDYixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDckIsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFBIn0=
\ No newline at end of file
diff --git a/dist/npmdocker.docker.d.ts b/dist/npmdocker.docker.d.ts
index 0b42837..8a338d3 100644
--- a/dist/npmdocker.docker.d.ts
+++ b/dist/npmdocker.docker.d.ts
@@ -5,3 +5,4 @@ import * as plugins from "./npmdocker.plugins";
*/
export declare let checkDocker: () => plugins.q.Promise<{}>;
export declare let makeDockerReady: () => void;
+export declare let run: (configArg: any) => plugins.q.Promise<{}>;
diff --git a/dist/npmdocker.docker.js b/dist/npmdocker.docker.js
index 6b88ff2..48aaf93 100644
--- a/dist/npmdocker.docker.js
+++ b/dist/npmdocker.docker.js
@@ -14,4 +14,9 @@ exports.checkDocker = () => {
return done.promise;
};
exports.makeDockerReady = () => { };
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZG9ja2VyLmRvY2tlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWRvY2tlci5kb2NrZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE1BQVksT0FBTyxXQUFNLHFCQUFxQixDQUFDLENBQUE7QUFHL0M7O0dBRUc7QUFDUSxtQkFBVyxHQUFHO0lBQ3JCLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsRUFBRSxDQUFBLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQSxDQUFDO1FBQ2hDLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztJQUNuQixDQUFDO0lBQUMsSUFBSSxDQUFDLENBQUM7UUFDSixJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksS0FBSyxDQUFDLGtDQUFrQyxDQUFDLENBQUMsQ0FBQztJQUMvRCxDQUFDO0lBQ0QsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFDO0FBRVMsdUJBQWUsR0FBRyxRQUFPLENBQUMsQ0FBQyJ9
\ No newline at end of file
+exports.run = (configArg) => {
+ let done = plugins.q.defer();
+ done.resolve(configArg);
+ return done.promise;
+};
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZG9ja2VyLmRvY2tlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWRvY2tlci5kb2NrZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE1BQVksT0FBTyxXQUFNLHFCQUFxQixDQUFDLENBQUE7QUFHL0M7O0dBRUc7QUFDUSxtQkFBVyxHQUFHO0lBQ3JCLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsRUFBRSxDQUFBLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQSxDQUFDO1FBQ2hDLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztJQUNuQixDQUFDO0lBQUMsSUFBSSxDQUFDLENBQUM7UUFDSixJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksS0FBSyxDQUFDLGtDQUFrQyxDQUFDLENBQUMsQ0FBQztJQUMvRCxDQUFDO0lBQ0QsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7QUFDeEIsQ0FBQyxDQUFDO0FBRVMsdUJBQWUsR0FBRyxRQUFPLENBQUMsQ0FBQztBQUUzQixXQUFHLEdBQUcsQ0FBQyxTQUFTO0lBQ3ZCLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDN0IsSUFBSSxDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQztJQUN4QixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztBQUN4QixDQUFDLENBQUEifQ==
\ No newline at end of file
diff --git a/dist/npmdocker.promisechain.d.ts b/dist/npmdocker.promisechain.d.ts
index b2379c5..76d1519 100644
--- a/dist/npmdocker.promisechain.d.ts
+++ b/dist/npmdocker.promisechain.d.ts
@@ -1,3 +1,3 @@
///
import * as plugins from "./npmdocker.plugins";
-export declare let promisechain: () => plugins.q.Promise<{}>;
+export declare let run: () => plugins.q.Promise<{}>;
diff --git a/dist/npmdocker.promisechain.js b/dist/npmdocker.promisechain.js
index e1b625f..e7f85d6 100644
--- a/dist/npmdocker.promisechain.js
+++ b/dist/npmdocker.promisechain.js
@@ -1,7 +1,13 @@
"use strict";
const plugins = require("./npmdocker.plugins");
-exports.promisechain = () => {
+//modules
+const ConfigModule = require("./npmdocker.config");
+const DockerModule = require("./npmdocker.docker");
+exports.run = () => {
let done = plugins.q.defer();
+ ConfigModule.run()
+ .then(DockerModule.run)
+ .then(done.resolve);
return done.promise;
};
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZG9ja2VyLnByb21pc2VjaGFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWRvY2tlci5wcm9taXNlY2hhaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE1BQVksT0FBTyxXQUFNLHFCQUFxQixDQUFDLENBQUE7QUFJcEMsb0JBQVksR0FBRztJQUN0QixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQSJ9
\ No newline at end of file
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtZG9ja2VyLnByb21pc2VjaGFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWRvY2tlci5wcm9taXNlY2hhaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE1BQVksT0FBTyxXQUFNLHFCQUFxQixDQUFDLENBQUE7QUFHL0MsU0FBUztBQUNULE1BQVksWUFBWSxXQUFNLG9CQUFvQixDQUFDLENBQUE7QUFDbkQsTUFBWSxZQUFZLFdBQU0sb0JBQW9CLENBQUMsQ0FBQTtBQUV4QyxXQUFHLEdBQUc7SUFDYixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLFlBQVksQ0FBQyxHQUFHLEVBQUU7U0FDYixJQUFJLENBQUMsWUFBWSxDQUFDLEdBQUcsQ0FBQztTQUN0QixJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFBO0lBQ3ZCLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO0FBQ3hCLENBQUMsQ0FBQSJ9
\ No newline at end of file
diff --git a/ts/index.ts b/ts/index.ts
index 5eac451..e267a9d 100644
--- a/ts/index.ts
+++ b/ts/index.ts
@@ -1,12 +1,5 @@
import * as plugins from "./npmdocker.plugins";
-import * as paths from "./npmdocker.paths";
-import * as docker from "./npmdocker.docker";
-import {promisechain} from "./npmdocker.promisechain";
-
-let config = plugins.npmextra.dataFor({
- toolName:"npmdocker",
- defaultSettings: {},
- cwd: ""
-});
+import * as promisechain from "./npmdocker.promisechain";
+promisechain.run();
diff --git a/ts/npmdocker.config.ts b/ts/npmdocker.config.ts
new file mode 100644
index 0000000..5fde002
--- /dev/null
+++ b/ts/npmdocker.config.ts
@@ -0,0 +1,14 @@
+import * as plugins from "./npmdocker.plugins";
+import * as paths from "./npmdocker.paths";
+
+let config = plugins.npmextra.dataFor({
+ toolName:"npmdocker",
+ defaultSettings: {},
+ cwd: ""
+});
+
+export let run = () => {
+ let done = plugins.q.defer();
+ done.resolve(config);
+ return done.promise;
+}
\ No newline at end of file
diff --git a/ts/npmdocker.docker.ts b/ts/npmdocker.docker.ts
index 1e2ae6d..507c81a 100644
--- a/ts/npmdocker.docker.ts
+++ b/ts/npmdocker.docker.ts
@@ -4,14 +4,60 @@ import * as paths from "./npmdocker.paths";
/**
* check if docker is available
*/
-export let checkDocker = () => {
+let checkDocker = (configArg) => {
let done = plugins.q.defer();
if(plugins.shelljs.which("docker")){
- done.resolve();
+ done.resolve(configArg);
} else {
done.reject(new Error("docker not found on this machine"));
}
return done.promise;
};
-export let makeDockerReady = () => {};
\ No newline at end of file
+/**
+ * builds the Dockerfile according to the config in the project
+ */
+let buildDockerFile = () => {
+ let done = plugins.q.defer();
+ return done.promise
+};
+
+/**
+ * builds the Dockerimage from the built Dockerfile
+ */
+let buildDockerImage = () => {
+ let done = plugins.q.defer();
+ return done.promise
+};
+
+/**
+ * creates a container by running the built Dockerimage
+ */
+let runDockerImage = () => {
+ let done = plugins.q.defer();
+ return done.promise
+};
+
+let deleteDockerContainter = () => {
+ let done = plugins.q.defer();
+ return done.promise
+};
+
+let deleteDockerImage = () => {
+ let done = plugins.q.defer();
+ return done.promise
+};
+
+
+
+export let run = (configArg) => {
+ let done = plugins.q.defer();
+ checkDocker(configArg)
+ .then(buildDockerFile)
+ .then(buildDockerImage)
+ .then(runDockerImage)
+ .then(deleteDockerContainter)
+ .then(deleteDockerImage)
+ .then(done.resolve)
+ return done.promise;
+}
\ No newline at end of file
diff --git a/ts/npmdocker.promisechain.ts b/ts/npmdocker.promisechain.ts
index 7e096c7..1f885e5 100644
--- a/ts/npmdocker.promisechain.ts
+++ b/ts/npmdocker.promisechain.ts
@@ -1,8 +1,14 @@
import * as plugins from "./npmdocker.plugins";
import * as paths from "./npmdocker.paths";
-import * as docker from "./npmdocker.docker";
-export let promisechain = () => {
+//modules
+import * as ConfigModule from "./npmdocker.config";
+import * as DockerModule from "./npmdocker.docker";
+
+export let run = () => {
let done = plugins.q.defer();
+ ConfigModule.run()
+ .then(DockerModule.run)
+ .then(done.resolve)
return done.promise;
}
\ No newline at end of file
diff --git a/ts/npmdocker.snippets.ts b/ts/npmdocker.snippets.ts
new file mode 100644
index 0000000..0ea48f2
--- /dev/null
+++ b/ts/npmdocker.snippets.ts
@@ -0,0 +1,13 @@
+import * as plugins from "./npmdocker.plugins";
+
+export interface IDockerfileSnippet {
+ baseImage:string;
+ command:string;
+}
+
+export let dockerfileSnippet = (optionsArg:IDockerfileSnippet) => {
+ return `
+ FROM ${optionsArg.baseImage}
+
+ `
+}
\ No newline at end of file