From d52cd4b5824cea9aba6c24ed964bbc16bcad0c3b Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 20 Mar 2018 22:29:00 +0000 Subject: [PATCH] Created Design: Runnable Project (markdown) --- Design:-Runnable-Project.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Design:-Runnable-Project.md diff --git a/Design:-Runnable-Project.md b/Design:-Runnable-Project.md new file mode 100644 index 0000000..1107d5b --- /dev/null +++ b/Design:-Runnable-Project.md @@ -0,0 +1,24 @@ +One of the goals of the Projects feature is to treat a project as a deployable artefact. + +It should be possible to deploy a project without using the editor. For example: + +``` +1. git clone https://example.com/my-node-red-project.git +2. cd my-node-red-project +3. npm install +4. npm start -- --credentialSecret="my-secret-key" +``` + +### Missing pieces + +We can't quite do this today. Here are the missing pieces: + +1. the project's `package.json` needs to list `node-red` as a dependency. On balance, I think this is the right approach, rather than treat node-red as an assumed prerequisite. I don't think we should do this be default; maybe add a checkbox in the project settings' dependencies page to include `node-red`. +2. it must be possible to point node-red at a project on start-up, without using the editor to do so. Currently we overload the flowFile argument to set the active project - but that only works if the project is 'known'. It would be better to point at a `projectDir` wherever it may exist. +3. it must be possible to provide the credentialSecret for the project without it being part of any of the version controlled files. Options for this include: + - env var - `NODE_RED_CREDENTIAL_SECRET` + - command-line flag - `--credentialSecret="..."` + +The package would provide an npm start script that runs node-red with the appropriate command-line args. + +