Reference: Seed/Import Latest Version
When developing content in ESP, users often need to seed it or import the latest version - to do this there several options:
1. The make import
command
This command will load all the content that is defined in the production configuration
Commonly this may be slow and not ideal to run every time a change is made to a single .yml file, and in that case users may want to consider options #2 and #3 below for more rapid development.
2. Use the client to import the specific file making changes
The form of such command would be
esp -P {Port where ESP is running} -u {user} -p {password} import {model} path/to/yml
An example for importing a specific protocol:
1 esp -P 8402 import protocol content/protocols/Centrifuge.yml
Notice the user and password flags don’t need to be there if running locally with the default user and pass.
To see all the models that can be imported in this way, run
esp import -h
which will provide a list of models.
3. The client watch command
The watch command will ‘watch’ a file for changes, so if there be a lot of frequent changes to a specific file that will be imported every time, users may use it in this way:
esp --port 8102 watch import report content/applets/enrollment/Enrollment-Applets.yml
Notice the example is pointing to a .yml file that contains the applet definitions, but not the html itself
It is smart enough to look at all the files within and run the import command any time that the underlying files change as well
4. The client export
command
This command allows users to export a specific model from ESP to yaml:
esp --port 8102 export workflow "My Workflow" > my_workflow.yml
esp --port 8102 export --shallow workflow "My Workflow" > my_workflow.yml
When run with the
--shallow
option, only the requested object will be exportedIf the requested object references other types of objects, they will be referenced by name
Without
--shallow
, references to other objects will, in many cases, include the definition for the other objectFor instance, a workflow exported without
--shallow
will also embed the protocol definitions for all protocolsPipeline protocols will include the Pipeline definition, which will include all task definitions with
--shallow
, exporting a workflow would export only the workflow details with a list of protocol names
5. The client dump
command
This command allows users to effectively dump the entire database-backed ESP configuration to yaml
6. The make ext
command reloads the client and server extensions/invokables
Run
make clientext
ormake serverext
to specifically reload only the client extension/invokables or only the server extension/invokables