Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ docker image. Keys are docker image target paths and values are lein
project source paths.

The `:tag` value supplies a repository name (and optionally a tag) to
be applied to the resulting image in case of success.
be applied to the resulting image in case of success. If `:project-version-tag`
is set to `true`, the Leiningen project version is used as the tag.
In this case, the `:tag` value refers only to the repository name.

The `:base-image` value is used to specify the base image from which
the project image is built (defaults to `pallet/java`).
Expand Down Expand Up @@ -94,6 +96,13 @@ resulting image in case of success can be specified using `-t`.
lein uberimage -t user/repo:tag
```

The Leiningen project version can be used as the image tag
via the `-p` option.

```
lein uberimage -t user/repo -p
```

## Limitations

Currently your project needs to build with lein uberjar (as `lein
Expand Down
7 changes: 6 additions & 1 deletion src/leiningen/uberimage.clj
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
(str "Repository name (and optionally a tag) to be applied to the "
"resulting image in case of success")
:validate [string? "Must be a string"]]
["-p" "--project-version-tag"
(str "Use the Leiningen project version as the image tag. "
"The repository name is then specified with -t.")]
["-T" "--tlsverify TLSVERIFY"
"Use TLS and verify the remote"
:default (:verify env-endpoint)]
Expand Down Expand Up @@ -199,7 +202,9 @@
:trust-store ts-path
:trust-store-pass ks-pw}
req (filter-api-params {:body piped-input-stream
:t (:tag options)})
:t (if (:project-version-tag options)
(str (:tag options) ":" (:version project))
(:tag options))})
resp (try
(build ep req)
(catch java.net.ConnectException e
Expand Down