summaryrefslogtreecommitdiffstats
path: root/docs/en/erlang.mk/1/guide/releases
diff options
context:
space:
mode:
Diffstat (limited to 'docs/en/erlang.mk/1/guide/releases')
-rw-r--r--docs/en/erlang.mk/1/guide/releases/index.html59
1 files changed, 59 insertions, 0 deletions
diff --git a/docs/en/erlang.mk/1/guide/releases/index.html b/docs/en/erlang.mk/1/guide/releases/index.html
index 9ebd52ba..e3c46057 100644
--- a/docs/en/erlang.mk/1/guide/releases/index.html
+++ b/docs/en/erlang.mk/1/guide/releases/index.html
@@ -195,6 +195,65 @@ http://www.gnu.org/software/src-highlite -->
<div class="paragraph"><p>Your release was upgraded!</p></div>
</div>
</div>
+<div class="sect1">
+<h2 id="_getting_relx_semver_value">Getting Relx semver value</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>There is a <strong>workaround</strong> to get the semver value which is
+generated by Relx based on VCS history.</p></div>
+<div class="paragraph"><p>Create a file <em>rel/version</em> with only one line inside:</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt>{{ <span style="color: #FF6600">release_version</span> }}</tt></pre></div></div>
+<div class="paragraph"><p>Add/Update the <code>overlay</code> section of your <code>relx.config</code>:</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt>{<span style="color: #FF6600">overlay</span>, [
+ {<span style="color: #FF6600">template</span>, <span style="color: #FF0000">"rel/version"</span>, <span style="color: #FF0000">"version"</span>}
+]}<span style="color: #990000">.</span></tt></pre></div></div>
+<div class="paragraph"><p>When you run <code>make rel</code> it creates the file <em>$(RELX_OUTPUT_DIR)/example/version</em>
+which contains the version value generated by Relx.</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt>$ cat _rel/app/release
+<span style="color: #993399">1.0</span><span style="color: #990000">.</span><span style="color: #993399">0</span><span style="color: #990000">+</span>build<span style="color: #990000">.</span><span style="color: #993399">11</span><span style="color: #990000">.</span>ref5612aa0</tt></pre></div></div>
+<div class="paragraph"><p>In your <code>Makefile</code> you can use this simple snippet to get the version,
+but please keep in mind that this should depend on the <code>rel</code> target:</p></div>
+<div class="listingblock">
+<div class="content"></div></div>
+<div class="paragraph"><p>For example:</p></div>
+<div class="listingblock">
+<div class="content"></div></div>
+<div class="paragraph"><p>Would output:</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt>$ make myrecipe
+<span style="color: #990000">...</span>
+<span style="color: #990000">===&gt;</span> Starting relx build process <span style="color: #990000">...</span>
+<span style="color: #990000">===&gt;</span> Resolving OTP Applications from directories<span style="color: #990000">:</span>
+ /home/username/example/apps
+ /home/username/example/deps
+ /usr/lib/erlang/lib
+ /home/username/example<span style="color: #990000">/</span>_rel
+<span style="color: #990000">===&gt;</span> Resolved example-<span style="color: #993399">0.3</span><span style="color: #990000">.</span><span style="color: #993399">10</span><span style="color: #990000">+</span>build<span style="color: #990000">.</span><span style="color: #993399">11</span><span style="color: #990000">.</span>ref5612aa0
+<span style="color: #990000">===&gt;</span> Including Erts from /usr/lib/erlang
+<span style="color: #990000">===&gt;</span> release successfully created<span style="color: #990000">!</span>
+<span style="color: #990000">===&gt;</span> tarball /home/username/example<span style="color: #990000">/</span>_rel/example/example-<span style="color: #993399">0.3</span><span style="color: #990000">.</span><span style="color: #993399">10</span><span style="color: #990000">+</span>build<span style="color: #990000">.</span><span style="color: #993399">11</span><span style="color: #990000">.</span>ref5612aa0<span style="color: #990000">.</span>tar<span style="color: #990000">.</span>gz successfully created<span style="color: #990000">!</span>
+echo APP_VERSION <span style="color: #990000">=</span> <span style="color: #993399">0.3</span><span style="color: #990000">.</span><span style="color: #993399">10</span><span style="color: #990000">+</span>build<span style="color: #990000">.</span><span style="color: #993399">11</span><span style="color: #990000">.</span>ref5612aa0
+APP_VERSION <span style="color: #990000">=</span> <span style="color: #993399">0.3</span><span style="color: #990000">.</span><span style="color: #993399">10</span><span style="color: #990000">+</span>build<span style="color: #990000">.</span><span style="color: #993399">11</span><span style="color: #990000">.</span>ref5612aa0</tt></pre></div></div>
+</div>
+</div>