From 76f24ead3bd5225c2ad27c5601a92b6a9be3b30f Mon Sep 17 00:00:00 2001 From: Rodney Osodo Date: Fri, 20 Dec 2024 12:52:32 +0300 Subject: [PATCH 1/4] docs: remove test docs and move it to docs repo Signed-off-by: Rodney Osodo --- test.md | 104 -------------------------------------------------------- 1 file changed, 104 deletions(-) delete mode 100644 test.md diff --git a/test.md b/test.md deleted file mode 100644 index d9a98c6..0000000 --- a/test.md +++ /dev/null @@ -1,104 +0,0 @@ -# Test - -Start docker composition - -```bash -cd docker -docker compose up -``` - -Login as admin user - -```bash -USER_TOKEN=$(magistrala-cli users token admin 12345678 | jq -r .access_token) -``` - -Create a domain - -```bash -DOMAIN_ID=$(magistrala-cli domains create demo demo $USER_TOKEN | jq -r .id) -``` - -Create a thing called manager - -```bash -magistrala-cli things create '{"name": "Propeller Manager", "tags": ["manager", "propeller"], "status": "enabled"}' $DOMAIN_ID $USER_TOKEN -``` - -Set the following environment variables from the respose - -```bash -export MANAGER_THING_ID="" -export MANAGER_THING_KEY="" -``` - -Create a channel called manager - -```bash -magistrala-cli channels create '{"name": "Propeller Manager", "tags": ["manager", "propeller"], "status": "enabled"}' $DOMAIN_ID $USER_TOKEN -``` - -Set the following environment variables from the respose - -```bash -export MANAGER_CHANNEL_ID="" -``` - -Connect the thing to the manager channel - -```bash -magistrala-cli things connect $MANAGER_THING_ID $MANAGER_CHANNEL_ID $DOMAIN_ID $USER_TOKEN -``` - -Create a thing called proplet - -```bash -magistrala-cli things create '{"name": "Propeller Proplet", "tags": ["proplet", "propeller"], "status": "enabled"}' $DOMAIN_ID $USER_TOKEN -``` - -Set the following environment variables from the respose - -```bash -export PROPLET_THING_ID="" -export PROPLET_THING_KEY="" -``` - -Connect the thing to the manager channel - -```bash -magistrala-cli things connect $PROPLET_THING_ID $MANAGER_CHANNEL_ID $DOMAIN_ID $USER_TOKEN -``` - -Publish create message to the manager channel. This creates a new proplet. - -```bash -mosquitto_pub -u $PROPLET_THING_ID -P $PROPLET_THING_KEY -I propeller -t channels/$MANAGER_CHANNEL_ID/messages/control/proplet/create -h localhost -m "{\"proplet_id\": \"$PROPLET_THING_ID\", \"name\": \"proplet-1\"}" -``` - -Publish alive message to the manager channel. This updates the proplet. - -```bash -mosquitto_pub -u $PROPLET_THING_ID -P $PROPLET_THING_KEY -I propeller -t channels/$MANAGER_CHANNEL_ID/messages/control/proplet/alive -h localhost -m "{\"proplet_id\": \"$PROPLET_THING_ID\"}" -``` - -To start the manager, run the following command - -```bash -export MANAGER_THING_ID="" -export MANAGER_THING_KEY="" -export PRMANAGER_CHANNEL_ID="" -export PROPLET_THING_ID="" -export PROPLET_THING_KEY="" -propeller-manager -``` - -To start the proplet, run the following command - -```bash -export MANAGER_THING_ID="" -export MANAGER_THING_KEY="" -export PROPLET_CHANNEL_ID="" -export PROPLET_THING_ID="" -export PROPLET_THING_KEY="" -propeller-proplet -``` From 8d35a4d40980a7ab807b13367d43e6da3f7bc4f4 Mon Sep 17 00:00:00 2001 From: Rodney Osodo Date: Fri, 20 Dec 2024 12:52:56 +0300 Subject: [PATCH 2/4] chore: add golang dep grouping Signed-off-by: Rodney Osodo --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6caa6e4..3f9ddf0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -17,3 +17,7 @@ updates: interval: "weekly" day: "monday" timezone: "Europe/Paris" + groups: + go-dependency: + patterns: + - "*" From a0907e7e1f10a6da75bda12187beff93052f9c01 Mon Sep 17 00:00:00 2001 From: Rodney Osodo Date: Fri, 20 Dec 2024 12:53:37 +0300 Subject: [PATCH 3/4] docs: add documentation for makefile Signed-off-by: Rodney Osodo --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 57467f8..1936136 100644 --- a/Makefile +++ b/Makefile @@ -49,11 +49,11 @@ help: @echo "Usage: make " @echo "" @echo "Targets:" - @echo " build: build the binary" - @echo " install: install the binary" - @echo " all: build the binary" - @echo " clean: clean the build directory" - @echo " lint: run golangci-lint" + @echo " : build the binary for the service i.e manager, proplet, cli" + @echo " all: build all binaries i.e manager, proplet, cli" + @echo " install: install the binary i.e copies to GOBIN" + @echo " clean: clean the build directory" + @echo " lint: run golangci-lint" @echo " start-magistrala: start the magistrala docker compose" @echo " stop-magistrala: stop the magistrala docker compose" - @echo " help: display this help message" + @echo " help: display this help message" From 0b0bd06a2608df1a45e3f1359dfeec609a67b641 Mon Sep 17 00:00:00 2001 From: Rodney Osodo Date: Wed, 8 Jan 2025 23:14:47 +0300 Subject: [PATCH 4/4] chore: rename propellerd to cli Signed-off-by: Rodney Osodo --- {propellerd => cli}/log.go | 2 +- {propellerd => cli}/tasks.go | 2 +- cmd/cli/main.go | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) rename {propellerd => cli}/log.go (97%) rename {propellerd => cli}/tasks.go (99%) diff --git a/propellerd/log.go b/cli/log.go similarity index 97% rename from propellerd/log.go rename to cli/log.go index c9f74b6..92a0d77 100644 --- a/propellerd/log.go +++ b/cli/log.go @@ -1,4 +1,4 @@ -package propellerd +package cli import ( "encoding/json" diff --git a/propellerd/tasks.go b/cli/tasks.go similarity index 99% rename from propellerd/tasks.go rename to cli/tasks.go index bc3ec1a..b64051e 100644 --- a/propellerd/tasks.go +++ b/cli/tasks.go @@ -1,4 +1,4 @@ -package propellerd +package cli import ( "github.com/absmach/propeller/pkg/sdk" diff --git a/cmd/cli/main.go b/cmd/cli/main.go index 4bb4bf0..5268d6b 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -3,8 +3,8 @@ package main import ( "log" + "github.com/absmach/propeller/cli" "github.com/absmach/propeller/pkg/sdk" - "github.com/absmach/propeller/propellerd" "github.com/spf13/cobra" ) @@ -15,15 +15,15 @@ func main() { Long: `Propeller CLI is a command line interface for interacting with Propeller components.`, PersistentPreRun: func(_ *cobra.Command, _ []string) { sdkConf := sdk.Config{ - ManagerURL: propellerd.DefManagerURL, - TLSVerification: propellerd.DefTLSVerification, + ManagerURL: cli.DefManagerURL, + TLSVerification: cli.DefTLSVerification, } s := sdk.NewSDK(sdkConf) - propellerd.SetSDK(s) + cli.SetSDK(s) }, } - tasksCmd := propellerd.NewTasksCmd() + tasksCmd := cli.NewTasksCmd() rootCmd.AddCommand(tasksCmd)