javascript-query
or javascript-index
.
To make life easier when dealing with these stages, ConfigSync adopts a smart approach.
Storing JS scripts separately
Instead of embedding JS scripts directly within the pipeline configuration, ConfigSync saves the script content to separate files. This setup not only makes it easier to view and edit the scripts but also keeps your pipeline configurations clean and manageable.Where JS files are stored
- All JS files related to pipelines are stored in a
/js
folder within the specific pipeline folder.
For index pipelines, this would be/index-pipelines/js
, and for query pipelines,/query-pipelines/js
. - Within the
/js
folder, there’s a subfolder named after the pipeline to which the scripts belong.
This helps keep everything organized and easy to find. - The name of the JS file can vary and is typically based on the stage label used within ConfigSync.
However, it’s crucial that these files are correctly linked to their corresponding pipeline stages.
Linking JS files to pipeline stages
This linking is achieved through a meta-file, which maps each stage ID to its JS filename. Here’s how it works:- If your pipeline configuration is stored at
app/index-pipelines/pipeline.json
, - Then your meta-file is located at
app/.metadata/index-pipelines/pipeline.json
.
The pattern here is simple: just add/.metadata
before the pipeline folder in the path. - This applies to both index and query pipelines.