Automatically pull from GitHub



  • Hi.
    I'm running jsreport at AWS Fargate. Fargate cannot have persistent storage allocated (to my knowledge), so I have to load all templates onto the ephemeral disk on every reboot.

    For now I have this hacky workflow for working with the templates:

    1. Local dev-environment in Docker has a mounted local disk for report templates. This is version controlled with git.

    2. After making changes locally, or after upgrading the Fargate container I manually export all templates from local dev and import to production.

    As of now we are not in full production, so the hack works. But I need to streamline this.

    Does anyone have any suggestion for creating the following functions:

    A. Upon each startup of jsreport, pull from master.
    B. Upon a call to some REST endpoint (or a script called via SSH), pull from master.

    I'm also very interested in other suggestions. How do other people solve this?



  • Have you also considered to have the templates inside the container image?

    It seems you don't want to edit your templates in production. Have you considered also aws lambda? We have a dedicated tutorial for it.
    https://jsreport.net/learn/aws-lambda-serverless

    Does anyone have any suggestion for creating the following functions:
    A. Upon each startup of jsreport, pull from master.
    B. Upon a call to some REST endpoint (or a script called via SSH), pull from master.

    In both cases, you would need to create your own container image and implement this functionality.



  • Thanks.
    No I don't want to rebuild the image for every new report I add.

    Do you think I'll get into trouble if I remotely trigger a git pull?
    Does jsreport lock any of the template files, or can I safely replace the files during uptime?
    What happens to currently rendering reports?
    Can I halt jsreport in any way so I can safely replace all template files?



  • The templates are cached in the memory.
    There is a monitor for the changes of data files and your pull would cause a refresh of memory state.
    However, it is not designed for this use case, it is designed for refreshing and auto previewing of single changes.
    I would not recommend you to do it this way, it can happen not all the changes are refreshed.
    It is just not that robust.

    Probably similar problem can be found here
    https://forum.jsreport.net/topic/880/files-updated-externally-are-not-consistently-detected/9


Log in to reply
 

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