Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add info about tedge-command-plugin #4

Merged
merged 4 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ thin-edge.io Cumulocity IoT shell plugin to process the `c8y_Command` operation.

### What will be deployed to the device?

* Cumulocity IoT command handler (binary) that allows users to execute a command in a shell
* Cumulocity IoT command handler that allows users to execute a command in a shell

**Technical summary**

Expand All @@ -24,12 +24,26 @@ The following details the technical aspects of the plugin to get an idea what sy

The following linux package formats are provided on the releases page and also in the [tedge-community](https://cloudsmith.io/~thinedge/repos/community/packages/) repository:

**c8y-command-plugin**

**Warning:** This version is compatible with thin-edge.io > 1.0.0, but is now deprecated. Please upgrade to thin-edge.io >= 1.4.0 and use the new tedge-command-plugin instead.

|Operating System|Repository link|
|--|--|
|Debian/Raspian (deb)|[![Latest version of 'c8y-command-plugin' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/thinedge/community/deb/c8y-command-plugin/latest/a=all;d=any-distro%252Fany-version;t=binary/?render=true&show_latest=true)](https://cloudsmith.io/~thinedge/repos/community/packages/detail/deb/c8y-command-plugin/latest/a=all;d=any-distro%252Fany-version;t=binary/)|
|Alpine Linux (apk)|[![Latest version of 'c8y-command-plugin' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/thinedge/community/alpine/c8y-command-plugin/latest/a=noarch;d=alpine%252Fany-version/?render=true&show_latest=true)](https://cloudsmith.io/~thinedge/repos/community/packages/detail/alpine/c8y-command-plugin/latest/a=noarch;d=alpine%252Fany-version/)|
|RHEL/CentOS/Fedora (rpm)|[![Latest version of 'c8y-command-plugin' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/thinedge/community/rpm/c8y-command-plugin/latest/a=noarch;d=any-distro%252Fany-version;t=binary/?render=true&show_latest=true)](https://cloudsmith.io/~thinedge/repos/community/packages/detail/rpm/c8y-command-plugin/latest/a=noarch;d=any-distro%252Fany-version;t=binary/)|

**tedge-command-plugin**

**Warning:** This version is only compatible with thin-edge.io >= 1.4.0.

|Operating System|Repository link|
|--|--|
|Debian/Raspian (deb)|[![Latest version of 'tedge-command-plugin' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/thinedge/community/deb/tedge-command-plugin/latest/a=all;d=any-distro%252Fany-version;t=binary/?render=true&show_latest=true)](https://cloudsmith.io/~thinedge/repos/community/packages/detail/deb/tedge-command-plugin/latest/a=all;d=any-distro%252Fany-version;t=binary/)|
|Alpine Linux (apk)|[![Latest version of 'tedge-command-plugin' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/thinedge/community/alpine/tedge-command-plugin/latest/a=noarch;d=alpine%252Fany-version/?render=true&show_latest=true)](https://cloudsmith.io/~thinedge/repos/community/packages/detail/alpine/tedge-command-plugin/latest/a=noarch;d=alpine%252Fany-version/)|
|RHEL/CentOS/Fedora (rpm)|[![Latest version of 'tedge-command-plugin' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/thinedge/community/rpm/tedge-command-plugin/latest/a=noarch;d=any-distro%252Fany-version;t=binary/?render=true&show_latest=true)](https://cloudsmith.io/~thinedge/repos/community/packages/detail/rpm/tedge-command-plugin/latest/a=noarch;d=any-distro%252Fany-version;t=binary/)|

#### Configuration

The Cumulocity IoT shell plugin can be configured with the following properties.
Expand All @@ -44,7 +58,7 @@ The configuration is managed from the following file, and an example of the cont
**File**

```sh
/etc/c8y-command-plugin/env
/etc/tedge-command-plugin/env
```

**Contents**
Expand Down
1 change: 0 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set export
IMAGE := env_var_or_default("IMAGE", "debian-12")

build *ARGS:
./ci/build.sh {{ARGS}} -- -f nfpm.c8y-command-plugin.yaml
./ci/build.sh {{ARGS}} -- -f nfpm.tedge-command-plugin.yaml

publish *ARGS:
Expand Down
19 changes: 16 additions & 3 deletions nfpm.tedge-command-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,26 @@ license: MIT
apk:
# Use noarch instead of "all"
arch: noarch
depends:
- jq

replaces:
- c8y-command-plugin
provides:
- c8y-command-plugin

overrides:
deb:
depends:
- jq
- tedge (> 1.3.1)
rpm:
depends:
- jq
- tedge > 1.3.1
apk:
# alpine - assume tedge is already installed as containers just have the binary (no apk package)
depends:
- jq

scripts:
preinstall: ./src/packaging/preinst

Expand All @@ -47,7 +60,7 @@ contents:
group: tedge

- src: ./src/env
dst: /etc/c8y-command-plugin/env
dst: /etc/tedge-command-plugin/env
type: config|noreplace
file_info:
mode: 0644
Expand Down
2 changes: 1 addition & 1 deletion src/tedge-command-plugin/shell_execute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SHELL_OPTIONS="bash sh"
SHELL_BIN=

# Load settings file
SETTINGS_FILE=/etc/c8y-command-plugin/env
SETTINGS_FILE=/etc/tedge-command-plugin/env
if [ -f "$SETTINGS_FILE" ]; then
FOUND_FILE=$(find "$SETTINGS_FILE" -perm 644 | head -n1)

Expand Down
Loading