Skip to content

Commit

Permalink
Merge pull request #16 from thin-edge/docs-remove-old-software-type-s…
Browse files Browse the repository at this point in the history
…yntax

docs: remove old sm-plugin software type syntax
  • Loading branch information
reubenmiller authored Jul 22, 2024
2 parents 41f158a + 9d3d39c commit decc99f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,17 @@ tar cvzf "$ARCHIVE" .
Then add the version
```sh
c8y software versions create --software nodered-demo --version "$VERSION::nodered" --file ./nodered-demo__master@32256bb.tar.gz
c8y software versions create --software nodered-demo --version "$VERSION" --file ./nodered-demo__master@32256bb.tar.gz
# Or using wildcards
c8y software versions create --software nodered-demo --version "$VERSION::nodered" --file ./nodered-demo__*@*.tar.gz
c8y software versions create --software nodered-demo --version "$VERSION" --file ./nodered-demo__*@*.tar.gz
```
3. Create an active flow software entry to control which item should be active. There should be one per flow
```sh
c8y software create --name active-flow --description "Active node-red flow" --data softwareType=nodered
c8y software versions create --software active-flow --version "nodered-demo::nodered" --url " "
c8y software versions create --software active-flow --version "nodered-demo" --url " "
```
### Uploading a project using an external URL
Expand All @@ -177,7 +177,7 @@ tar cvzf "$ARCHIVE" .
2. Create a software version item in Cumulocity IoT
```sh
c8y software versions create --software nodered-demo --version "latest::nodered" --file ./tests/testdata/nodered-demo.cfg
c8y software versions create --software nodered-demo --version "latest" --file ./tests/testdata/nodered-demo.cfg
```
## Future ideas
Expand Down
6 changes: 3 additions & 3 deletions src/sm-plugin/nodered
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,14 @@ EOF

prepare)
# Enable Node-RED projects feature (required by this plugin)
if ! grep -F "NODE_RED_ENABLE_PROJECTS=" "$NODERED_DIR/EnvironmentFile" -q >/dev/null 2>&1; then
if ! grep -F "NODE_RED_ENABLE_PROJECTS=" "$NODERED_DIR/environment" -q >/dev/null 2>&1; then
SUDO=""
if is_root; then
# Extract using the user node-red user to prevent file reading problems
SUDO="sudo -u $NODERED_USER"
fi
log "Enabling Node-RED projects. Adding NODE_RED_ENABLE_PROJECTS=true to $NODERED_DIR/EnvironmentFile"
echo "NODE_RED_ENABLE_PROJECTS=true" | $SUDO tee "$NODERED_DIR/EnvironmentFile" >/dev/null
log "Enabling Node-RED projects. Adding NODE_RED_ENABLE_PROJECTS=true to $NODERED_DIR/environment"
echo "NODE_RED_ENABLE_PROJECTS=true" | $SUDO tee "$NODERED_DIR/environment" >/dev/null

# Restart is required after activating project feature
restart_node_red
Expand Down

0 comments on commit decc99f

Please sign in to comment.