Script to zip templates folder



  • Let say we use the local Studio to design our reports ( console app with the Js.Local nuget package)
    Templates are saved on disk using the file system store.
    The whole templates folder structure created by the studio is saved in our source control.

    Now I'm looking for the simplest way to push the templates files into JsReport online, within my DevOps CI pipeline.

    I was hoping i could make JsReport Online use my own Azure blob storage, and simply move the files there, but it is not supported as per this thread:
    https://forum.jsreport.net/topic/1511/jsreportonline

    As I understand it, I would have to do these steps in the CI environment:

    • npm install jsreport (100+mb download)
    • start jsreport
    • use the jsreport-cli export command
    • push the export.zip to jsreport online

    These steps would be done on every build, which seems a bit overkill to me, so I'd like to know if there is a simpler way that would not involve downloading, installing and spinning up a jsreport instance just to bundle the template files into a .zip.

    Is there a simple script that can zip the templates folder into the expected format?
    Thanks!



  • The steps would be:

    npm i -g jsreport-cli
    jsreport init
    jsreport export out.zip
    jsreport import ...
    

    Or you can just put to your source control the jsreport.exe and export without downloading and installing additional things.

    jsreport export out.zip
    

    I don't see a better approach I am afraid.
    However, the build is usually an overkill downloading a lot of stuff every time, it is a trade off, so I wouldn't worry probably.
    At least form my perspective, don't know your environment specs and situation of course.



  • As you said, i should probably not worry.

    I tried these steps, but my export zip didn't contain any entities.
    The issue was I had some configuration made via the LocalReporting class in C#.
    But when executing jsreport from cli, it use the jsreport.config.json instead.
    So once I replicate the configuration within jsreport.config.json, all is working.

    Thanks a lot!


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.