diff --git a/README.md b/README.md index da63413..3dd28e9 100644 --- a/README.md +++ b/README.md @@ -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** @@ -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. @@ -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** diff --git a/justfile b/justfile index 028ffad..ca84360 100644 --- a/justfile +++ b/justfile @@ -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: diff --git a/nfpm.tedge-command-plugin.yaml b/nfpm.tedge-command-plugin.yaml index bd288f6..88049d8 100644 --- a/nfpm.tedge-command-plugin.yaml +++ b/nfpm.tedge-command-plugin.yaml @@ -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 @@ -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 diff --git a/src/tedge-command-plugin/shell_execute.sh b/src/tedge-command-plugin/shell_execute.sh index 996bd2e..f4573b6 100755 --- a/src/tedge-command-plugin/shell_execute.sh +++ b/src/tedge-command-plugin/shell_execute.sh @@ -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)