commands.tex 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. \section{Commands}
  2. Synrc mad has a simple interface as follows:
  3. \vspace{1\baselineskip}
  4. \begin{lstlisting}
  5. MAD Container Tool version b547fa
  6. BNF:
  7. invoke = mad params
  8. params = [] | run params
  9. run = command [ options ]
  10. command = app | deps | clean | compile | up
  11. | release [ beam | ling | script | runc | depot ]
  12. | deploy | start | stop | attach | sh
  13. \end{lstlisting}
  14. \vspace{1\baselineskip}
  15. It seems to us more natural, you can specify random
  16. commands set with different specifiers (options).
  17. \subsection{deps}
  18. In rebar-like managers we are selecting deps from rebar.config:
  19. \vspace{1\baselineskip}
  20. \begin{lstlisting}
  21. {sub_dirs,["apps"]}.
  22. {deps_dir,"deps"}.
  23. {deps, [active,{nitro,"2.9"},{n2o,"2.9"}]}.
  24. \end{lstlisting}
  25. \vspace{1\baselineskip}
  26. \subsection{compile, com}
  27. Performs compilation of all known compilations backends in complilation profile of mad:
  28. \vspace{1\baselineskip}
  29. \begin{lstlisting}
  30. app — app.src erlang templating
  31. dtl — DTL compiler
  32. erl — BEAM compiler
  33. c/c++ — for gcc cland and other native compilation
  34. script — .script file used in projects like gproc
  35. yrl/xrl — DSL language parser compilers
  36. upl — UPL compiler
  37. \end{lstlisting}
  38. \vspace{1\baselineskip}
  39. \subsection{release, rel}
  40. Taking all dependecies and resolve boot sequence according to dependecy order.
  41. Storing this value in .applist. If release type is not defined ({\bf beam} in following example),
  42. then {\bf script} release will be taken as a default.
  43. \vspace{1\baselineskip}
  44. \begin{lstlisting}
  45. $ mad release beam sample
  46. Ordered: [kernel,stdlib,fs,ranch,crypto,compiler,syntax_tools,
  47. gproc,cowlib,cowboy,n2o,sample,active,erlydtl,jsone,
  48. mad,nitro,sh]
  49. *WARNING* : Missing application sasl. Can not upgrade with this release
  50. sample.boot: ok
  51. OK: "sample"
  52. $ mad rel mad
  53. Ordered: [kernel,stdlib,inets,sh,mad]
  54. OK: "mad"
  55. \end{lstlisting}
  56. \vspace{1\baselineskip}
  57. MAD supports several releasing backends:
  58. \vspace{1\baselineskip}
  59. \begin{lstlisting}
  60. script — script bundles, like mad itself
  61. beam — ERTS releases with systools
  62. ling — LING portable unikernels
  63. runc — Docker-compatible containers
  64. depot — releases from binary repositories
  65. \end{lstlisting}
  66. \vspace{1\baselineskip}
  67. \subsection{sh}
  68. Start REPL shell session.