From c478467812afbaed0767d688718446066003dbfa Mon Sep 17 00:00:00 2001 From: reubenmiller Date: Fri, 13 Dec 2024 21:50:10 +0100 Subject: [PATCH 1/4] docs: add info about tedge-command-plugin --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index da63413..8635bb9 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** + +This version is compatible with + |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. From c0634ca26bc617a769a5a15dd337077a46d846aa Mon Sep 17 00:00:00 2001 From: reubenmiller Date: Tue, 17 Dec 2024 09:14:13 +0100 Subject: [PATCH 2/4] add deprecation warning for the c8y-command-plugin --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8635bb9..0644a3d 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ The following linux package formats are provided on the releases page and also i **c8y-command-plugin** -This version is compatible with +**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| |--|--| From 76e0f7765b4137f31df21065e410387c3095db60 Mon Sep 17 00:00:00 2001 From: reubenmiller Date: Tue, 17 Dec 2024 09:14:49 +0100 Subject: [PATCH 3/4] add tedge as dependency to formally declare a minimum thin-edge.io version --- nfpm.tedge-command-plugin.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/nfpm.tedge-command-plugin.yaml b/nfpm.tedge-command-plugin.yaml index bd288f6..cf1ac10 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 From 67a75d54583fa4dc4ee5b140d009aa1c742f84f0 Mon Sep 17 00:00:00 2001 From: reubenmiller Date: Tue, 17 Dec 2024 09:18:02 +0100 Subject: [PATCH 4/4] skip building the now deprecated c8y-command-plugin --- README.md | 2 +- justfile | 1 - nfpm.tedge-command-plugin.yaml | 2 +- src/tedge-command-plugin/shell_execute.sh | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0644a3d..3dd28e9 100644 --- a/README.md +++ b/README.md @@ -58,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 cf1ac10..88049d8 100644 --- a/nfpm.tedge-command-plugin.yaml +++ b/nfpm.tedge-command-plugin.yaml @@ -60,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)