Using Rockamalg
Enapter Rockamalg allows you to amalgamate Lua files with dependencies into single Lua script. When you upload your blueprint, Enapter Cloud internally uses rockamalg
to amalgamate Lua files.
You can use it too! If you already use tools like lua-amalg and use luarocks to manage dependencies, rockamalg
helps you to simplify amalgamation process.
The commands below show how to pass this tutorial, but amalgamate Lua script using rockamalg
tool instead of modifying manifest.yml
.
Amalgamate Directory​
To amalgamate Lua directory src
into a single file ucm.lua
:
docker run --rm -it -v $(pwd):/app enapter/rockamalg amalg -o ucm.lua src
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 src
with dependencies described in file named deps
:
docker run --rm -it -v $(pwd):/app enapter/rockamalg amalg -o ucm.lua -d deps src
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 src