'project' update from command line

Hi, I love the Project feature. Version control of flows is awesome.

I am delighted that, within the admin pages, I can update projects (git revert, git pull + deploy) and any on-screen data keeps its history (dashboard line graphs over time do not reset to an empty view..the data is preserved!!!) I'll call that a hot redeploy. That is brilliant (and conversely losing data would be devastating).
So, now I want to edit my master flow & check it into git. (so far so good) Then, for any/all sites, I want to automate the git pull and see the flow updated. I can do a git pull from the command line just fine, but (not surprisingly) the in-memory flow is not updated. I do not want to stop and restart node red because I'd lose charted data (though as a small consolation prize, I do expect the updated flow nodes would be picked up).

The node red Admin view is capable of doing what I want (click to revert changes, pull, and hot-redeploy)
I need to be able to automate it for the dozen (dozens? hundreds maybe?) of node red sites that use this project's code, and preferably from the (linux) command line. Is there any hook I can leverage that initiates a project's revert, pull, and hot-redeploy? I can work with a web interface to do this because I can presumably use curl to drive the web interface.

It's an important-enough feature that if I have to run node red as "an embedded instance" and write some node.js code to pull it off, I'll attempt to do so, but it sure would be great if I don't have to write this feature.


Some of the nodes available for installation allow persistence of data across restarts of Node-RED. This appears as an option in the Node UI. Also - there are example flows showing persistence into local storage by reading the output of a chart:

E.g. Simple save and restore for node-red-dashboard chart (flow) - Node-RED (found by searching the forum)

Finally - you might want to consider a Database as a 'real' persistence method - 'devastating' is a word you should resolve through better architecture. Hundreds of sites = more risk. Reporting / charting against hundreds of instances sounds fragile without serious thought. The (regular) Dashboard is single-user and struggles with high volumes of displayed data points and is also not secured.



See the admin api POST /flows : Node-RED You can set which type of deploy you require as part of the post.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.