From 1c67537cefd110f0f099c0db39abeac57b2c5e2d Mon Sep 17 00:00:00 2001 From: Mark Birbeck Date: Thu, 12 Jul 2018 19:26:53 +0100 Subject: [PATCH 1/5] [#39] Add documentation on --repeat-while to README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6fdb355..3eee56d 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,12 @@ dj --showlogs --replicas 5 --repeat-until 'workflows?' hello-world The sequence will terminate if *any* of the replicas outputs a string that matches the regular expression provided. +To repeat a job as long as some string exists in the logs, then use the `--repeat-while` option. The following example will run as long as the time is 8pm and any number of seconds: + +```shell +dj --repeat-while '20:00:\d\d' alpine date +``` + ## Swarm on AWS To use a swarm that is running on AWS, create an SSH tunnel with the `---ssh-*` options. For example: From 03d2dc5a1081d87e9cc4d1afa10405e6fba16c4d Mon Sep 17 00:00:00 2001 From: Mark Birbeck Date: Thu, 12 Jul 2018 19:51:00 +0100 Subject: [PATCH 2/5] [#39] Add documentation on --rm to README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 3eee56d..fef1154 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,12 @@ To repeat a job as long as some string exists in the logs, then use the `--repea dj --repeat-while '20:00:\d\d' alpine date ``` +When a job has finished the service that supports it can be removed automatically with the `--rm` option: + +```shell +dj --rm --repeat-while '20:00:\d\d' alpine date +``` + ## Swarm on AWS To use a swarm that is running on AWS, create an SSH tunnel with the `---ssh-*` options. For example: From 3cd0c3795caa85bdf557a991842051d125e9ee3a Mon Sep 17 00:00:00 2001 From: Mark Birbeck Date: Thu, 12 Jul 2018 20:38:46 +0100 Subject: [PATCH 3/5] [#39] Add documentation on --volume to README --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index fef1154..2501928 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,13 @@ When a job has finished the service that supports it can be removed automaticall dj --rm --repeat-while '20:00:\d\d' alpine date ``` +To map a volume use `--volume` or `-v`: + +```shell +dj -v /var/run/docker.sock:/var/run/docker.sock \ + tmaier/docker-compose docker-compose up +``` + ## Swarm on AWS To use a swarm that is running on AWS, create an SSH tunnel with the `---ssh-*` options. For example: From 0c89e4e6308cce7a7b4e4f9c1c825626852822cb Mon Sep 17 00:00:00 2001 From: Mark Birbeck Date: Thu, 12 Jul 2018 20:40:45 +0100 Subject: [PATCH 4/5] [#39] Add documentation on --env to README --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 2501928..d38f84f 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,17 @@ dj -v /var/run/docker.sock:/var/run/docker.sock \ tmaier/docker-compose docker-compose up ``` +To provide one or more environment variables use `--env` or `-e`: + +```shell +dj \ + -v /var/run/docker.sock:/var/run/docker.sock \ + --env DBHOST=server \ + --env DBPASS=xyz \ + tmaier/docker-compose \ + docker-compose up +``` + ## Swarm on AWS To use a swarm that is running on AWS, create an SSH tunnel with the `---ssh-*` options. For example: From 8e5423196a64ac55d165d5770b75851017a35b7c Mon Sep 17 00:00:00 2001 From: Mark Birbeck Date: Thu, 12 Jul 2018 20:49:12 +0100 Subject: [PATCH 5/5] Bump version number and update CHANGELOG --- CHANGELOG.md | 12 ++++++++++-- package.json | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6da0cbf..1cebb4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,13 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [v0.6.0] - 2018-07-12 +### Added +- Add option to remove service when complete (#5). +- Add option to pass environment variables to service (#31). +- Add option to pass volume mapping to a service (#32). +- Add option to repeat a job while a condition exists (#36). + ## [v0.5.0] - 2018-06-21 ### Added - Pass parameters after the image through as arguments (#25). ## [v0.4.1] - 2018-06-20 ### Added -- Add option to repeat a job until/while a condition exists (#14). +- Add option to repeat a job until a condition exists (#14). - When repeating tasks, relaunch job rather than creating new one (#21). ### Fixed - Unknown states cause run to exit (#11). @@ -33,9 +40,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add CLI parameters (#1). -[Unreleased]: https://github.com/markbirbeck/docker-job/compare/v0.2.1...HEAD +[Unreleased]: https://github.com/markbirbeck/docker-job/compare/v0.6.0...HEAD [v0.2.0]: https://github.com/markbirbeck/docker-job/compare/v0.1.0...v0.2.0 [v0.2.1]: https://github.com/markbirbeck/docker-job/compare/v0.2.0...v0.2.1 [v0.3.1]: https://github.com/markbirbeck/docker-job/compare/v0.2.1...v0.3.1 [v0.4.1]: https://github.com/markbirbeck/docker-job/compare/v0.3.1...v0.4.1 [v0.5.0]: https://github.com/markbirbeck/docker-job/compare/v0.4.1...v0.5.0 +[v0.6.0]: https://github.com/markbirbeck/docker-job/compare/v0.5.0...v0.6.0 diff --git a/package.json b/package.json index 0e1e8fe..d1f37df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "docker-job", - "version": "0.5.0", + "version": "0.6.0", "description": "Run a single job as a Docker Service on Docker Swarm", "bin": { "dj": "./src/bin/cli.js"