Skip to content

Commit

Permalink
Merge pull request #41 from markbirbeck/39-document-new-options
Browse files Browse the repository at this point in the history
39 document new options
  • Loading branch information
markbirbeck authored Jul 12, 2018
2 parents f1f676d + 8e54231 commit 14d39c2
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,36 @@ 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
```

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
```

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
```

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:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 14d39c2

Please sign in to comment.