-- Doc --
Integrating With External Tools
Sinan provides a mechenism to integrate with external tools. This is via the hooks functionality. This functionality is used by putting a directory called '_hooks' in the root of your project. Inside this directory you place executable files that implement the functionality you want to run. When these files are run is determenid by there name. The are named in the form of '<when>-<task>'. The when is may be one of two values, either 'pre' or 'post'. The task is the name of the task you want the thing to run around. For example, if you wanted something to run just after the build task is complete you would create a file called 'post-build' and make it executable. This file will then be run (in the context of the root directory) immediatly after the build task and before any other tasks or run. A file called 'pre-build' would do just the opposite, running imeditaly before the build task.
Having the ability to run these files at specific times is good. However, without getting some information from sinan its not terribly useful. Fortunatly, there is a mechenism for getting this information. Sinan passes it to the running script via environmental variables. There are two sets of environmental variables that are passed. The first is the global information about the project. These variables are available as follows.
The file path of the erlang/erlware installation that sinan is running out of.
The erts version that sinan is building of
The build directory where the projectis being built too
The current build flavor of the system
The unique id for this run of sinan
The project root directory
The project name as defined in the build config
The project version
A comma seperated list of apps that are part of the project.
A comma seperated list of apps that are dependencies of the project
The second set environmental variables that are available for each application and dependency in the project. The 'APP' in the following descriptions is replaced by the name of the app in upper case. These values are as follows.
The version of the application
The file path to the application that sinan is using.
A comma seperated list of the names of the dependent applicatinos for this application.
The combination of scripts and environmental variables should be enough to do most required actions on the these tertiary builds.