Skip to main content

Using Rockamalg

Enapter Rockamalg allows you to amalgamate Lua files with dependencies into single Lua script. When you send your blueprint to Enapter Cloud it uses this tool.

You can use it to amalgamate your Lua files. For example, you can pass this tutorial, but amalgamate Lua script using rockamalg tool instead of modifying manifest.yml.

Amalgamate Directory#

To amalgamate Lua directory fw into a single file ucm.lua:

docker run --rm -it -v $(pwd):/app enapter/rockamalg amalg -o ucm.lua fw

Amalgamate Lua Script With Dependencies#

Dependencies is a file with names of Luarocks packages. They are described in luarocks format. It looks like:

lua-string ~> 1.2
beemovie == 1.0.1

To amalgamate Lua directory fw with dependencies described in file named deps:

docker run --rm -it -v $(pwd):/app enapter/rockamalg amalg -o ucm.lua -d deps fw

Using Existing Rockspec#

As you already now, you can use rockspec file to describe dependencies. To use it with rockamalg:

docker run --rm -it -v $(pwd):/app enapter/rockamalg amalg -o ucm.lua -r my-dev-1.rockspec fw
Hardware diversity is welcome. Integrate any device into a unified energy network.
© 2021 Enapter
Developer toolkit
DocumentationReference
Community
GithubTindie