From cef0dbd2b5a1809c5cfb2a0699edaae137cea6c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 29 Oct 2016 13:43:00 +0300 Subject: Update user guide --- guide/getting_started.html | 2 +- guide/index.html | 2 +- guide/relx.html | 19 +++++++++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/guide/getting_started.html b/guide/getting_started.html index 524c4f2..06b92cd 100644 --- a/guide/getting_started.html +++ b/guide/getting_started.html @@ -41,7 +41,7 @@ to your remote repositories. For example, for GitHub users, put all your projects in a common folder with the same name as your username. For example $HOME/ninenines/cowboy for the Cowboy project.

2.2. Downloading Erlang.mk

At the time of writing, Erlang.mk is unlikely to be present -in your Erlang distribution, or even in your OS packages.

The next step is therefore to download it:

$ wget https://erlang.mk/erlang.mk

Or:

$ curl https://erlang.mk/erlang.mk -o erlang.mk

Alternatively, just click on this link.

Make sure you put the file inside the folder we created previously.

2.3. Getting started with OTP applications

An OTP application is an Erlang application that has a supervision +in your Erlang distribution, or even in your OS packages.

The next step is therefore to download it:

$ wget https://erlang.mk/erlang.mk

Or:

$ curl -O https://erlang.mk/erlang.mk

Alternatively, just click on this link.

Make sure you put the file inside the folder we created previously.

2.3. Getting started with OTP applications

An OTP application is an Erlang application that has a supervision tree. In other words, it will always have processes running.

This kind of project can be automatically generated by Erlang.mk. All you need to do is use the bootstrap target:

$ make -f erlang.mk bootstrap

Something similar to the following snippet will then appear on your screen:

git clone https://github.com/ninenines/erlang.mk .erlang.mk.build
diff --git a/guide/index.html b/guide/index.html
index 9970f89..aa50a94 100644
--- a/guide/index.html
+++ b/guide/index.html
@@ -33,7 +33,7 @@ div.navfooter{margin-bottom:1em}
 
 
-

Erlang.mk User Guide

Loïc Hoguin


Table of Contents

1. Installation
1.1. On Unix
1.2. On Windows
2. Getting started
2.1. Creating a folder for your project
2.2. Downloading Erlang.mk
2.3. Getting started with OTP applications
2.4. Getting started with OTP libraries
2.5. Getting started with OTP releases
2.6. Getting started from scratch
2.7. Using spaces instead of tabs
2.8. Using templates
2.9. Hiding Erlang.mk from git
2.10. Getting help
3. Overview
3.1. Building your project
3.2. Exploring the package index
3.3. Generating documentation
3.4. Running tests
3.5. Need more?
4. Updating Erlang.mk
4.1. Initial bootstrap
4.2. Updating
4.3. Customizing the build
5. Limitations
5.1. Erlang must be available
5.2. Spaces in path
5.3. Dependency tracking and modification times
I. Code
6. Building
6.1. How to build
6.2. What to build
6.3. Application resource file
6.4. Automatic application resource file values
6.5. File formats
6.6. Compilation options
6.7. Cold and hot builds
6.8. Dependency tracking
6.9. Generating Erlang source
6.10. Cleaning
7. Packages and dependencies
7.1. Searching packages
7.2. Adding dependencies to your project
7.3. How deps are fetched and built
7.4. Fetching and listing dependencies only
7.5. Ignoring unwanted dependencies
7.6. Dependencies directory
7.7. Many applications in one repository
7.8. Repositories with no application at the root level
7.9. Autopatch
7.10. Skipping deps
8. NIFs and port drivers
8.1. C source code location and Erlang environment
8.2. Using a custom Makefile
8.3. Using Erlang.mk directly
9. Releases
9.1. Setup
9.2. Configuration
9.3. Generating the release
9.4. Running the release
10. Escripts
11. Compatibility with other build tools
11.1. Rebar projects as Erlang.mk dependencies
11.2. Erlang.mk projects as Rebar dependencies
II. Documentation
12. AsciiDoc documentation
12.1. Requirements
12.2. Writing AsciiDoc documentation
12.3. Configuration
12.4. Usage
13. EDoc comments
13.1. Writing EDoc comments
13.2. Configuration
13.3. Usage
III. Tests
14. Erlang shell
14.1. Configuration
14.2. Usage
15. EUnit
15.1. Writing tests
15.2. Configuration
15.3. Usage
16. Common Test
16.1. Writing tests
16.2. Configuration
16.3. Usage
17. Code coverage
18. Continuous integration
19. Dialyzer
19.1. How it works
19.2. Configuration
19.3. Usage
20. Xref
IV. Third-party plugins
21. External plugins
21.1. Loading all plugins from a dependency
21.2. Loading one plugin from a dependency
21.3. Writing external plugins
22. List of plugins
22.1. efene.mk
22.2. elixir.mk
22.3. elvis.mk
22.4. geas
22.5. hexer.mk
22.6. hexpm.mk
22.7. jorel
22.8. lfe.mk
22.9. mix.mk
22.10. reload.mk
22.11. rust.mk
V. About Erlang.mk
23. Why Erlang.mk
23.1. Erlang.mk is fast
23.2. Erlang.mk gives you the full power of Unix
23.3. Erlang.mk is a text file
23.4. Erlang.mk can manage Erlang itself
23.5. Erlang.mk can do more than Erlang
23.6. Erlang.mk integrates nicely in Make and Automake projects
24. Short history
24.1. Before Erlang.mk
24.2. Lifetime of the project
25. Contributing
25.1. Priorities
25.2. Bugs
25.3. Code
25.4. Packages
25.5. Documentation
25.6. Feature requests
+

Erlang.mk User Guide

Loïc Hoguin


Table of Contents

1. Installation
1.1. On Unix
1.2. On Windows
2. Getting started
2.1. Creating a folder for your project
2.2. Downloading Erlang.mk
2.3. Getting started with OTP applications
2.4. Getting started with OTP libraries
2.5. Getting started with OTP releases
2.6. Getting started from scratch
2.7. Using spaces instead of tabs
2.8. Using templates
2.9. Hiding Erlang.mk from git
2.10. Getting help
3. Overview
3.1. Building your project
3.2. Exploring the package index
3.3. Generating documentation
3.4. Running tests
3.5. Need more?
4. Updating Erlang.mk
4.1. Initial bootstrap
4.2. Updating
4.3. Customizing the build
5. Limitations
5.1. Erlang must be available
5.2. Spaces in path
5.3. Dependency tracking and modification times
I. Code
6. Building
6.1. How to build
6.2. What to build
6.3. Application resource file
6.4. Automatic application resource file values
6.5. File formats
6.6. Compilation options
6.7. Cold and hot builds
6.8. Dependency tracking
6.9. Generating Erlang source
6.10. Cleaning
7. Packages and dependencies
7.1. Searching packages
7.2. Adding dependencies to your project
7.3. How deps are fetched and built
7.4. Fetching and listing dependencies only
7.5. Ignoring unwanted dependencies
7.6. Dependencies directory
7.7. Many applications in one repository
7.8. Repositories with no application at the root level
7.9. Autopatch
7.10. Skipping deps
8. NIFs and port drivers
8.1. C source code location and Erlang environment
8.2. Using a custom Makefile
8.3. Using Erlang.mk directly
9. Releases
9.1. Setup
9.2. Configuration
9.3. Generating the release
9.4. Running the release
9.5. Upgrading a release
10. Escripts
11. Compatibility with other build tools
11.1. Rebar projects as Erlang.mk dependencies
11.2. Erlang.mk projects as Rebar dependencies
II. Documentation
12. AsciiDoc documentation
12.1. Requirements
12.2. Writing AsciiDoc documentation
12.3. Configuration
12.4. Usage
13. EDoc comments
13.1. Writing EDoc comments
13.2. Configuration
13.3. Usage
III. Tests
14. Erlang shell
14.1. Configuration
14.2. Usage
15. EUnit
15.1. Writing tests
15.2. Configuration
15.3. Usage
16. Common Test
16.1. Writing tests
16.2. Configuration
16.3. Usage
17. Code coverage
18. Continuous integration
19. Dialyzer
19.1. How it works
19.2. Configuration
19.3. Usage
20. Xref
IV. Third-party plugins
21. External plugins
21.1. Loading all plugins from a dependency
21.2. Loading one plugin from a dependency
21.3. Writing external plugins
22. List of plugins
22.1. efene.mk
22.2. elixir.mk
22.3. elvis.mk
22.4. geas
22.5. hexer.mk
22.6. hexpm.mk
22.7. jorel
22.8. lfe.mk
22.9. mix.mk
22.10. reload.mk
22.11. rust.mk
V. About Erlang.mk
23. Why Erlang.mk
23.1. Erlang.mk is fast
23.2. Erlang.mk gives you the full power of Unix
23.3. Erlang.mk is a text file
23.4. Erlang.mk can manage Erlang itself
23.5. Erlang.mk can do more than Erlang
23.6. Erlang.mk integrates nicely in Make and Automake projects
24. Short history
24.1. Before Erlang.mk
24.2. Lifetime of the project
25. Contributing
25.1. Priorities
25.2. Bugs
25.3. Code
25.4. Packages
25.5. Documentation
25.6. Feature requests
diff --git a/guide/relx.html b/guide/relx.html index 893aad1..3c07a4b 100644 --- a/guide/relx.html +++ b/guide/relx.html @@ -48,11 +48,26 @@ directory. You can also override it:

RELX_OUTPUT_
 release. As mentioned before, Erlang.mk will automatically
 generate it when it detects the $(RELX_CONFIG) file. This
 means the following command will also build the release:

$ make

If you need to generate the release, and only the release, -the rel target can be used:

$ make rel

9.4. Running the release

Erlang.mk provides a convenience function for running the +the rel target can be used:

$ make rel

Erlang.mk always generates a tarball alongside the release, +which can be directly uploaded to a server. The tarball is +located at $(RELX_OUTPUT_DIR)/<name>/<name>-<vsn>.tar.gz.

9.4. Running the release

Erlang.mk provides a convenience function for running the release with one simple command:

$ make run

This command will also build the project and generate the release if they weren’t already. It starts the release in console mode, meaning you will also have a shell ready to -use to check things as needed.

+use to check things as needed.

9.5. Upgrading a release

Erlang.mk provides a relup target for generating release +upgrades. Release upgrades allow updating the code and the +state of a running release without restarting it.

Once your changes are done, you need to update the version +of the application(s) that will be updated. You also need +to update the version of the release.

For each application that needs to be updated, an +appup file +must be written. Refer to the Erlang/OTP documentation +for more details.

For the purpose of this section, assume the initial release +version was 1, and the new version is 2. The name of the +release will be example.

Once all this is done, you can build the tarball for the +release upgrade:

$ make relup

This will create an archive at the root directory of the +release, $(RELX_OUTPUT_DIR)/example/example-2.tar.gz.

Move the archive to the correct location on the running +node. From the release’s root directory:

$ mkdir releases/2/
+$ mv path/to/example-2.tar.gz releases/2/

Finally, upgrade the release:

$ bin/example_release upgrade "2/example_release"

Or on Windows:

$ bin/example_release.cmd upgrade "2/example_release"

Your release was upgraded!

-- cgit v1.2.3