wiki:docs_module_depend

Version 19 (modified by ehb, 2 years ago) (diff)

--

defining module dependencies

  • module executable dependencies list dependency info
  • this section is used for installers
  • the JSON to include at the top level of the module definition file lists tags and their values
  • the tags can be:
tag value example(s) description
base string "base" : "perl"
"base" : "python"
"base" : "ubuntu"
the primary language used - if applicable
cpan string or list of strings "cpan" : "JSON"
"cpan" : [ "JSON", "MIME::Base64" ]
CPAN module(s) to install
pip string or list of strings "pip" : "numpy scipy matplotlib"
"pip" : [ "numpy scipy", "matplotlib" ]
Python PIP package(s) to install
conda string or list of strings "conda" : "scipy"
"conda" : [ "numpy scipy=0.15 -n py34_env", "matplotlib" ]
Python conda package(s) to install
run string or list of strings "run" : "git clone https://github.com/ehb54/jspdb.git"
"run" : [ "git clone https://github.com/ehb54/jspdb.git" , "ls" ]
run command(s)
run-os string or list of strings "run-ubuntu" : "apt install someapt"
"run-centos" : [ "yum install xyz", "mkdir -p /x/y/z" ]
run os specific command(s)
run-os-version string or list of strings "run-ubuntu-16" : "apt install someapt"
"run-centos-7" : [ "yum install xyz", "mkdir -p /x/y/z" ]
run os-version specific command(s)
file string or list of strings "file" : "somefile"
"file" : [ "my-dependency-1", "my-dependency-2" ]
extra file(s) needed, note the defined executable is not needed
env string or list of strings "env" : "MYENV=xyz"
"env" : [ "MYENV=xyz", "MYENV2=abc" ]
environment variable(s) to set
  • each tag can be repeated as many times as needed except for the "base" tag, which can only be entered once and must be the first entry
  • the processing is in sequential order, so cmd's processed and file's will be added in the sequence specified.
  • dependencies examples:
    • demo/energy (a perl script)
          ,"dependencies" : [
              { "base" : "perl" }
              ,{ "cpan" : "JSON" }
          ]
      
    • demo/penergy (a python script requiring files [really only one of the .py or .pyc are needed)
          ,"dependencies" : [
              { "base" : "python" }
              ,{ "file" : [ "mass_energy.pyc", "mass_energy.py" ] }
          ]
      

to do