NOISSUE - Improve running different versions

Signed-off-by: dusan <borovcanindusan1@gmail.com>
This commit is contained in:
dusan
2025-12-29 11:12:42 +01:00
parent 4dbdea585d
commit 8dc4d72b98
2 changed files with 39 additions and 7 deletions
+14 -2
View File
@@ -97,7 +97,7 @@ FILTERED_SERVICES = $(filter-out $(RUN_ADDON_ARGS), $(SERVICES))
all: $(SERVICES)
.PHONY: all $(SERVICES) dockers dockers_dev latest release run run_addons grpc_mtls_certs check_mtls check_certs test_api mocks
.PHONY: all $(SERVICES) dockers dockers_dev latest release run_latest run_stable run_addons grpc_mtls_certs check_mtls check_certs test_api mocks
clean:
rm -rf ${BUILD_DIR}
@@ -259,12 +259,24 @@ endif
fetch_supermq:
@./scripts/supermq.sh
run: check_certs
run_latest: check_certs
MG_ADDONS_CERTS_PATH_PREFIX="../." docker compose -f docker/docker-compose.yaml \
-f docker/addons/timescale-reader/docker-compose.yaml \
-f docker/addons/timescale-writer/docker-compose.yaml \
--env-file docker/.env -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args)
run_stable: check_certs
$(eval version = $(shell git describe --abbrev=0 --tags))
git checkout $(version)
sed -i 's/^SMQ_RELEASE_TAG=.*/SMQ_RELEASE_TAG=$(version)/' docker/supermq-docker/.env
sed -i 's/^MG_RELEASE_TAG=.*/MG_RELEASE_TAG=$(version)/' docker/.env
docker compose -f docker/docker-compose.yaml --env-file docker/.env -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args)
MG_ADDONS_CERTS_PATH_PREFIX="../." docker compose -f docker/docker-compose.yaml \
-f docker/addons/timescale-reader/docker-compose.yaml \
-f docker/addons/timescale-writer/docker-compose.yaml \
--env-file docker/.env -p $(DOCKER_PROJECT) $(DOCKER_COMPOSE_COMMAND) $(args)
run_addons: check_certs
$(foreach SVC,$(RUN_ADDON_ARGS),$(if $(filter $(SVC),$(ADDON_SERVICES) $(EXTERNAL_SERVICES)),,$(error Invalid Service $(SVC))))
@for SVC in $(RUN_ADDON_ARGS); do \
+25 -5
View File
@@ -53,22 +53,42 @@ Magistrala is a cutting-edge, open-source IoT cloud platform built on top of [Su
- 🏗️ **Domain-Driven Design**: High-quality codebase and extensive test coverage.
## 🔧 Install
## Installation 🛠️
Clone the repository and start the services:
There are multiple ways to run Magistrala.
First, clone the repository and position to it:
```bash
git clone https://github.com/absmach/magistrala.git
cd magistrala
docker compose -f docker/docker-compose.yaml --env-file docker/.env up
```
Alternatively, use the Makefile for a simpler command:
To run the latest stable (tagged) version, use:
```bash
make run args=-d
# Run with latest stable tagged version
make run_stable
```
To run the latest version, use:
```bash
# Run with latest development version (from main branch)
make run_latest
```
The `make run_stable` command will:
- Checkout the repository to the latest git tag
- Update the version in the environment configuration
- Start the services with the stable release
**Note:** After running `make run_stable`, you'll be on a detached HEAD state. To return to your working branch:
```bash
git checkout main
```
## 📤 Usage
#### Using the CLI: