aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-05-25 12:07:43 +0200
committerLoïc Hoguin <[email protected]>2017-05-25 12:07:43 +0200
commit381adec9007556081d45d58016c348b441774c93 (patch)
tree9631bbe7f324831e10680c7d9a89413bb17f9cb4 /doc
parentd0d628fbe6d3401125c271484c119c7d826c33b6 (diff)
downloaderlang.mk-381adec9007556081d45d58016c348b441774c93.tar.gz
erlang.mk-381adec9007556081d45d58016c348b441774c93.tar.bz2
erlang.mk-381adec9007556081d45d58016c348b441774c93.zip
Edit the previous doc addition
Diffstat (limited to 'doc')
-rw-r--r--doc/src/guide/releases.asciidoc42
1 files changed, 24 insertions, 18 deletions
diff --git a/doc/src/guide/releases.asciidoc b/doc/src/guide/releases.asciidoc
index e571992..b4fc5a2 100644
--- a/doc/src/guide/releases.asciidoc
+++ b/doc/src/guide/releases.asciidoc
@@ -119,57 +119,63 @@ $ bin/example_release.cmd upgrade "2/example_release"
Your release was upgraded!
-=== Getting relx semver value
+=== Getting Relx semver value
-There is a *workaround* to get the semver version value which is
-generated by relx based on VCS history.
+There is a *workaround* to get the semver value which is
+generated by Relx based on VCS history.
-Create `rel/version` file with only one line inside:
+Create a file 'rel/version' with only one line inside:
[source,erlang]
{{ release_version }}
-Add/Update `overlay` section of your `relx.config`
+Add/Update the `overlay` section of your `relx.config`:
[source,erlang]
{overlay, [
- {template, rel/version, version}
+ {template, "rel/version", "version"}
]}.
-So when you run `mare rel` it creates file like `_rel/app/version` which
-would contain the version value generated by relx
+When you run `mare rel` it creates the file '$(RELX_OUTPUT_DIR)/example/version'
+which contains the version value generated by Relx.
[source,bash]
$ cat _rel/app/release
1.0.0+build.11.ref5612aa0
-In your `Makefile` you can use this simple snippet to get the version.
-But please keep in mind that this should depend on `rel` target
+In your `Makefile` you can use this simple snippet to get the version,
+but please keep in mind that this should depend on the `rel` target:
[source,make]
$(shell cat $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/version)
-Here is an example of the `Makefile`:
+For example:
+
[source,make]
+----
include erlang.mk
-#--------------------------- Custom targets -----------------------------------
+
APP_VERSION = $(shell cat $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/version)
myrecipe: all
echo APP_VERSION = $(APP_VERSION)
+----
+
+Would output:
-The output would be like:
[source,bash]
+----
$ make myrecipe
...
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
- /home/username/myapp/apps
- /home/username/myapp/deps
+ /home/username/example/apps
+ /home/username/example/deps
/usr/lib/erlang/lib
- /home/username/myapp/_rel
-===> Resolved myapp-0.3.10+build.11.ref5612aa0
+ /home/username/example/_rel
+===> Resolved example-0.3.10+build.11.ref5612aa0
===> Including Erts from /usr/lib/erlang
===> release successfully created!
-===> tarball /home/username/myapp/_rel/myapp/myapp-0.3.10+build.11.ref5612aa0.tar.gz successfully created!
+===> tarball /home/username/example/_rel/example/example-0.3.10+build.11.ref5612aa0.tar.gz successfully created!
echo APP_VERSION = 0.3.10+build.11.ref5612aa0
APP_VERSION = 0.3.10+build.11.ref5612aa0
+----