From 59736793f0dfec55c2e36e64ca2ea505564454f1 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 21 Sep 2013 14:06:42 -0500 Subject: add overview, overlays and configuration pages --- configuration/index.md | 35 ++++++++++++++++++++++----------- overlays/index.md | 52 ++++++++++++++++++++++++++------------------------ 2 files changed, 51 insertions(+), 36 deletions(-) diff --git a/configuration/index.md b/configuration/index.md index b73f393..2c93e8a 100644 --- a/configuration/index.md +++ b/configuration/index.md @@ -19,9 +19,9 @@ App directories specify where `relx` will search for OTP applications to resolve The app directory configuration element looks as follows: -``` +{% highlight erl %} {lib_dirs, [, , ...]}. -``` +{% endhighlight %} Paths ----- @@ -33,12 +33,16 @@ provide a non-resolvable path for additional providers. The path configuration element looks as follows: +{% highlight erl %} {paths, []}. +{% endhighlight %} So if we wanted to add `/usr/local/lib` and `/opt/lib` to the code paths for the system we could add the following:: +{% highlight erl %} {paths, ["/usr/local/lib", "/opt/lib"]}. +{% endhighlight %} to our configuration. @@ -48,20 +52,21 @@ Releases Release configuration is the bread and butter, the blood and bones of the Relx system. It provides the framework for realizing dependencies in the system. The release element basically minics the -standard _Erlang/OTP Release Metadata file format: +standard Erlang/OTP Release Metadata file format: http://www.erlang.org/doc/man/rel.html. There are two main differences. The first is that you don't have to specify a complete list of applications and you may specify version constraints instead of hard versions. - +{% highlight erl %} {release, {relname, vsn}, } - {release, {relname, vsn}, + {release, {rkelname, vsn}, {erts, vsn}, } +{% endhighlight %} -See the [[Overview]] for goal syntax. +See the Overview for goal syntax. Start Script ------------ @@ -71,13 +76,14 @@ release. However, there may be times when you want to provide a custom start script. In those situations you may disable automatic start script creation by adding the following to your `relx.config`. +{% highlight erl %} {generate_start_script, false}. - +{% endhighlight %} Overlays -------- -These are documented on the [[Overlays]] wiki page. Go there for more +These are documented on the Overlays wiki page. Go there for more information. Advanced Options @@ -99,15 +105,19 @@ The `providers` element provides a completely new list of providers, replacing any providers that may already exist. The provider element is as follows:: +{% highlight erl %} {providers, }. +{% endhighlight %} Lets say I have three providers; `my_custom_assembler`, `my_rpm_assembler` and `my_deb_assembler`. I could make these the complete list of providers by doing the following in my config:: +{% highlight erl %} {providers, [my_custom_assembler, my_rpm_assembler, my_deb_assembler]}. +{% endhighlight %} Order is important in the providers as they will be executed in the order specified. @@ -119,20 +129,23 @@ the listed providers are added to the end of the current list of providers rather then replacing the list all together. Add providres looks as follows:: - +{% highlight erl %} {add_providers, }. +{% endhighlight %} Lets take our previous example but only add `my_rpm_assembler` and `my_deb_assembler` to the existing list of providers. We do this by adding the following:: +{% highlight erl %} {add_providers, [my_rpm_assembler, my_deb_assembler]}. +{% endhighlight %} Example Configuration --------------------- -```Erlang +{% highlight erl %} %% -*- mode: Erlang; fill-column: 80; comment-column: 75; -*- %% Example Relx Config %% ====================== @@ -210,4 +223,4 @@ Example Configuration %% can do this via a 'provider'. A provider is an implementation of the relx %% provider behaviour. This probably shouldn't be needed very often. {add_providers, [my_custom_functionality]}. -``` +{% endhighlight %} diff --git a/overlays/index.md b/overlays/index.md index a6b6c4e..dece340 100644 --- a/overlays/index.md +++ b/overlays/index.md @@ -11,12 +11,14 @@ can take your Overlay configuration and move it to your `relx.config` and it should just work. For example, you could take the following: +{% highlight erl %} {overlay_vars, "vars.config"}. {overlay, [{mkdir, "log/sasl"}, {copy, "files/erl", "{{erts_vsn}}/bin/erl"}, {copy, "files/nodetool", "{{erts_vsn}}/bin/nodetool"}, {template, "files/app.config", "etc/app.config"}, {template, "files/vm.args", "etc/vm.args"}]}. +{% endhighlight %} and move it directly from your `reltool.config` to your `relx.config` and it would work in exactly the same way. In Relx @@ -29,28 +31,28 @@ supported are listed below. Available Variables ------------------- -* *log* : The current log level in the format of `(:)` -* *output_dir* : The current output directory for the built release -* *target_dir* : The same as `output_dir`, exists for backwards compatibility -* *overridden* : The current list of overridden apps (a list of app names) -* *overrides.* : The override directory for said -* *goals* : The list of user specified goals in the system -* *lib_dirs* : The list of library directories, both user specified and derived -* *config_file* : The list of config file used in the system -* *providers* : The list of provider names used for this run of relx -* *sys_config* : The location of the sys config file -* *root_dir* : The root dir of the current project -* *default_release_name* : The current default release name for the relx run -* *default_release_version* : The current default release version for the relx run -* *default_release* : The current default release for the relx run -* *release_erts_version* : The version of the Erlang Runtime System in use -* *erts_vsn* : The same as `release_erts_vsn` (for backwards compatibility) -* *release_name* : The currently executing release -* *release_version* : the currently executing version -* *rel_vsn* : Same as `release_version`. Exists for backwards compatibility -* *release_applications* : A list of applications included in the release -* *release.[AppName].version : The version of `` -* *release.[AppName].dir : The on system directory of `` -* *release.[AppName].active_dependencies : The list of active application dependencies for `` -* *release.[AppName].library_dependencies : The list of library application dependencies for `` -* *release.[AppName].link : Indicates if this application should be linked in or not +* log : The current log level in the format of `(:)` +* output_dir : The current output directory for the built release +* target_dir : The same as `output_dir`, exists for backwards compatibility +* overridden : The current list of overridden apps (a list of app names) +* overrides.AppName : The override directory for said AppName +* goals : The list of user specified goals in the system +* lib_dirs : The list of library directories, both user specified and derived +* config_file : The list of config file used in the system +* providers : The list of provider names used for this run of relx +* sys_config : The location of the sys config file +* root_dir : The root dir of the current project +* default_release_name : The current default release name for the relx run +* default_release_version : The current default release version for the relx run +* default_release : The current default release for the relx run +* release_erts_version : The version of the Erlang Runtime System in use +* erts_vsn : The same as `release_erts_vsn` (for backwards compatibility) +* release_name : The currently executing release +* release_version : the currently executing version +* rel_vsn : Same as `release_version`. Exists for backwards compatibility +* release_applications : A list of applications included in the release +* release.AppName.version : The version of `AppName` +* release.AppName.dir : The on system directory of `AppName` +* release.AppName.active_dependencies : The list of active application dependencies for `AppName` +* release.AppName.library_dependencies : The list of library application dependencies for `AppName` +* release.AppName.link : Indicates if this application should be linked in or not -- cgit v1.2.3