diff options
Diffstat (limited to 'guide/relx.html')
-rw-r--r-- | guide/relx.html | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/guide/relx.html b/guide/relx.html index f210d5d..1f008a9 100644 --- a/guide/relx.html +++ b/guide/relx.html @@ -67,7 +67,30 @@ release will be <code class="literal">example</code>.</p><p>Once all this is don release upgrade:</p><pre class="programlisting">$ make relup</pre><p>This will create an archive at the root directory of the release, <code class="literal">$RELX_OUTPUT_DIR/example/example-2.tar.gz</code>.</p><p>Move the archive to the correct location on the running node. From the release’s root directory:</p><pre class="programlisting">$ mkdir releases/2/ -$ mv path/to/example-2.tar.gz releases/2/</pre><p>Finally, upgrade the release:</p><pre class="programlisting">$ bin/example_release upgrade "2/example_release"</pre><p>Or on Windows:</p><pre class="programlisting">$ bin/example_release.cmd upgrade "2/example_release"</pre><p>Your release was upgraded!</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ports.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="code.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sfx.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div> +$ mv path/to/example-2.tar.gz releases/2/</pre><p>Finally, upgrade the release:</p><pre class="programlisting">$ bin/example_release upgrade "2/example_release"</pre><p>Or on Windows:</p><pre class="programlisting">$ bin/example_release.cmd upgrade "2/example_release"</pre><p>Your release was upgraded!</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_getting_relx_semver_value"></a>9.6. Getting Relx semver value</h2></div></div></div><p>There is a <span class="strong"><strong>workaround</strong></span> to get the semver value which is +generated by Relx based on VCS history.</p><p>Create a file <span class="emphasis"><em>rel/version</em></span> with only one line inside:</p><pre class="programlisting">{{ release_version }}</pre><p>Add/Update the <code class="literal">overlay</code> section of your <code class="literal">relx.config</code>:</p><pre class="programlisting">{overlay, [ + {template, "rel/version", "version"} +]}.</pre><p>When you run <code class="literal">mare rel</code> it creates the file <span class="emphasis"><em>$(RELX_OUTPUT_DIR)/example/version</em></span> +which contains the version value generated by Relx.</p><pre class="programlisting">$ cat _rel/app/release +1.0.0+build.11.ref5612aa0</pre><p>In your <code class="literal">Makefile</code> you can use this simple snippet to get the version, +but please keep in mind that this should depend on the <code class="literal">rel</code> target:</p><pre class="programlisting">$(shell cat $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/version)</pre><p>For example:</p><pre class="programlisting">include erlang.mk + +APP_VERSION = $(shell cat $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/version) +myrecipe: all + echo APP_VERSION = $(APP_VERSION)</pre><p>Would output:</p><pre class="programlisting">$ make myrecipe +... +===> Starting relx build process ... +===> Resolving OTP Applications from directories: + /home/username/example/apps + /home/username/example/deps + /usr/lib/erlang/lib + /home/username/example/_rel +===> Resolved example-0.3.10+build.11.ref5612aa0 +===> Including Erts from /usr/lib/erlang +===> release 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</pre></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ports.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="code.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sfx.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div> </main> </body> </html> |