improve README
This commit is contained in:
		
							
								
								
									
										6
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,6 +1,4 @@ | |||||||
| docs/ |  | ||||||
| coverage/ |  | ||||||
| node_modules/ |  | ||||||
| .yarn/ | .yarn/ | ||||||
|  | node_modules/ | ||||||
|  | coverage/ | ||||||
| public/ | public/ | ||||||
| pages/ |  | ||||||
|   | |||||||
| @@ -1,12 +1,18 @@ | |||||||
| image: hosttoday/ht-docker-dbase:npmts | image: hosttoday/ht-docker-dbase:npmci | ||||||
| services: | services: | ||||||
|   - docker:dind |   - docker:dind | ||||||
|  |  | ||||||
|  | cache: | ||||||
|  |   paths: | ||||||
|  |   - .yarn/ | ||||||
|  |   key: "$CI_BUILD_STAGE" | ||||||
|  |  | ||||||
| stages: | stages: | ||||||
|   - build |   - build | ||||||
|   - test |   - test | ||||||
|   - release |   - release | ||||||
|   - trigger |   - trigger | ||||||
|  |   - pages | ||||||
|  |  | ||||||
| before_script: | before_script: | ||||||
|   - npmci prepare docker-gitlab |   - npmci prepare docker-gitlab | ||||||
| @@ -32,7 +38,7 @@ test: | |||||||
|     - priv |     - priv | ||||||
|  |  | ||||||
| release: | release: | ||||||
|   image: hosttoday/ht-docker-node:npmts |   image: hosttoday/ht-docker-node:npmci | ||||||
|   stage: release |   stage: release | ||||||
|   script: |   script: | ||||||
|     - npmci publish npm |     - npmci publish npm | ||||||
| @@ -43,7 +49,7 @@ release: | |||||||
|     - priv |     - priv | ||||||
|  |  | ||||||
| trigger: | trigger: | ||||||
|   image: hosttoday/ht-docker-node:npmts |   image: hosttoday/ht-docker-node:npmci | ||||||
|   stage: trigger |   stage: trigger | ||||||
|   script: |   script: | ||||||
|     - npmci trigger |     - npmci trigger | ||||||
| @@ -51,4 +57,19 @@ trigger: | |||||||
|     - tags |     - tags | ||||||
|   tags: |   tags: | ||||||
|     - lossless |     - lossless | ||||||
|     - priv |     - priv | ||||||
|  |  | ||||||
|  | pages: | ||||||
|  |   image: hosttoday/ht-docker-node:npmci | ||||||
|  |   stage: pages | ||||||
|  |   script: | ||||||
|  |     - npmci command yarn global add npmpage | ||||||
|  |     - npmci command npmpage --publish gitlab | ||||||
|  |   tags: | ||||||
|  |     - docker | ||||||
|  |   only: | ||||||
|  |     - tags | ||||||
|  |   artifacts: | ||||||
|  |     expire_in: 1 week | ||||||
|  |     paths: | ||||||
|  |     - public | ||||||
							
								
								
									
										29
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								README.md
									
									
									
									
									
								
							| @@ -1,11 +1,25 @@ | |||||||
| # dockersock | # dockersock | ||||||
| easy communication with docker remote api from node, TypeScript ready | easy communication with docker remote api from node, TypeScript ready | ||||||
|  |  | ||||||
| ## Status | ## Availabililty | ||||||
| [](https://gitlab.com/pushrocks/dockersock/commits/master) | [](https://www.npmjs.com/package/dockersock) | ||||||
|  | [](https://GitLab.com/mojoio/dockersock) | ||||||
|  | [](https://github.com/mojoio/dockersock) | ||||||
|  | [](https://mojoio.gitlab.io/dockersock/) | ||||||
|  |  | ||||||
|  | ## Status for master | ||||||
|  | [](https://GitLab.com/mojoio/dockersock/commits/master) | ||||||
|  | [](https://GitLab.com/mojoio/dockersock/commits/master) | ||||||
|  | [](https://www.npmjs.com/package/dockersock) | ||||||
|  | [](https://david-dm.org/mojoio/dockersock) | ||||||
|  | [](https://www.bithound.io/github/mojoio/dockersock/master/dependencies/npm) | ||||||
|  | [](https://www.bithound.io/github/mojoio/dockersock) | ||||||
|  | [](https://nodejs.org/dist/latest-v6.x/docs/api/) | ||||||
|  | [](https://nodejs.org/dist/latest-v6.x/docs/api/) | ||||||
|  | [](http://standardjs.com/) | ||||||
|  |  | ||||||
| ## Usage | ## Usage | ||||||
| We recommend the use of TypeScript for best Intellisense. | Use TypeScript for best in class instellisense. | ||||||
|  |  | ||||||
| ```TypeScript | ```TypeScript | ||||||
| import {Dockersock} from "dockersock"; // require Dockersock class | import {Dockersock} from "dockersock"; // require Dockersock class | ||||||
| @@ -25,4 +39,11 @@ myDockersock.newContainer({ // start new Container, equals "docker run" shell co | |||||||
|     image: "someimagetag" |     image: "someimagetag" | ||||||
| }) | }) | ||||||
|  |  | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
|  | For further information read the linked docs at the top of this README. | ||||||
|  |  | ||||||
|  | > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) | ||||||
|  | | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html) | ||||||
|  |  | ||||||
|  | [](https://mojo.io) | ||||||
|   | |||||||
							
								
								
									
										49
									
								
								docs/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								docs/README.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | |||||||
|  | # dockersock | ||||||
|  | easy communication with docker remote api from node, TypeScript ready | ||||||
|  |  | ||||||
|  | ## Availabililty | ||||||
|  | [](https://www.npmjs.com/package/dockersock) | ||||||
|  | [](https://GitLab.com/mojoio/dockersock) | ||||||
|  | [](https://github.com/mojoio/dockersock) | ||||||
|  | [](https://mojoio.gitlab.io/dockersock/) | ||||||
|  |  | ||||||
|  | ## Status for master | ||||||
|  | [](https://GitLab.com/mojoio/dockersock/commits/master) | ||||||
|  | [](https://GitLab.com/mojoio/dockersock/commits/master) | ||||||
|  | [](https://www.npmjs.com/package/dockersock) | ||||||
|  | [](https://david-dm.org/mojoio/dockersock) | ||||||
|  | [](https://www.bithound.io/github/mojoio/dockersock/master/dependencies/npm) | ||||||
|  | [](https://www.bithound.io/github/mojoio/dockersock) | ||||||
|  | [](https://nodejs.org/dist/latest-v6.x/docs/api/) | ||||||
|  | [](https://nodejs.org/dist/latest-v6.x/docs/api/) | ||||||
|  | [](http://standardjs.com/) | ||||||
|  |  | ||||||
|  | ## Usage | ||||||
|  | Use TypeScript for best in class instellisense. | ||||||
|  |  | ||||||
|  | ```TypeScript | ||||||
|  | import {Dockersock} from "dockersock"; // require Dockersock class | ||||||
|  |  | ||||||
|  | let myDockersock = new Dockersock(); // optional: you can pass a domain to the contructor, defaults to  /var/run/docker.sock | ||||||
|  |  | ||||||
|  | myDockersock.listContainers() // promise, resolve gets container data | ||||||
|  | myDockersock.listContainersDetailed() // promise, resolve gets more detailed container data (by combining several requests internally) | ||||||
|  | myDockersock.listContainersRunning() // promise, resolve gets container data for currently running containers | ||||||
|  | myDockersock.listContainersStopped() // promise, resolve gets container data for stopped containers | ||||||
|  |  | ||||||
|  | myDockersock.startContainer({ // starts a already present container | ||||||
|  |     name: "somecontainername" | ||||||
|  | }) | ||||||
|  |  | ||||||
|  | myDockersock.newContainer({ // start new Container, equals "docker run" shell command | ||||||
|  |     image: "someimagetag" | ||||||
|  | }) | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | For further information read the linked docs at the top of this README. | ||||||
|  |  | ||||||
|  | > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) | ||||||
|  | | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html) | ||||||
|  |  | ||||||
|  | [](https://mojo.io) | ||||||
							
								
								
									
										61
									
								
								test/test.ts
									
									
									
									
									
								
							
							
						
						
									
										61
									
								
								test/test.ts
									
									
									
									
									
								
							| @@ -1,35 +1,34 @@ | |||||||
| import "typings-global"; | import "typings-global"; | ||||||
| import { Dockersock } from "../dist/index"; |  | ||||||
| import { expect, tap } from 'tapbundle' | import { expect, tap } from 'tapbundle' | ||||||
|  |  | ||||||
| tap.test("dockersock", function () { | import { Dockersock } from "../dist/index"; | ||||||
|     tap.test(function () { |  | ||||||
|         let testDockersock: Dockersock; | let testDockersock: Dockersock; | ||||||
|         tap.ok(function () { |  | ||||||
|             testDockersock = new Dockersock(); | tap.test("should create a new Dockersock instance", async () => { | ||||||
|             testDockersock.should.be.instanceof(Dockersock); |     testDockersock = new Dockersock(); | ||||||
|         }, "should create a new Dockersock instance"); |     return expect(testDockersock).to.be.instanceof(Dockersock); | ||||||
|         tap.ok("should list containers", function (done) { | }); | ||||||
|             testDockersock.listContainers() |  | ||||||
|                 .then((dataArg) => { | tap.test("should list containers", async () => { | ||||||
|                     console.log(dataArg); |     await testDockersock.listContainers() | ||||||
|                     done(); |         .then(async (dataArg) => { | ||||||
|                 }); |             console.log(dataArg); | ||||||
|         }); |         }); | ||||||
|         tap.ok(function (done) { | }); | ||||||
|             testDockersock.listContainersDetailed() |  | ||||||
|                 .then((dataArg) => { | tap.test("should list detailed containers", async () => { | ||||||
|                     console.log(dataArg); |     await testDockersock.listContainersDetailed() | ||||||
|                     done(); |         .then(async (dataArg) => { | ||||||
|                 }); |             console.log(dataArg); | ||||||
|         }, "should list detailed containers"); |         }); | ||||||
|         tap.ok(function () { | }); | ||||||
|             return testDockersock.pullImage("hosttoday/ht-docker-dbase") |  | ||||||
|         }, "should pull an image from imagetag"); | tap.test("should pull an image from imagetag", async () => { | ||||||
|         tap.ok(function (done) { |     await testDockersock.pullImage("hosttoday/ht-docker-dbase") | ||||||
|             testDockersock.getChangeObservable(); | }); | ||||||
|             testDockersock.endRequests(); |  | ||||||
|             done(); | tap.test("should return a change Objservable", async () => { | ||||||
|         }, "should return a change Objservable") |     testDockersock.getChangeObservable(); | ||||||
|     }); |     testDockersock.endRequests(); | ||||||
| }); | }) | ||||||
		Reference in New Issue
	
	Block a user