From d1125f909171cc94e5112d2710ed620209ac309c Mon Sep 17 00:00:00 2001
From: Bastien DUMONT <bdumont@grandlyon.com>
Date: Fri, 24 Mar 2023 08:28:02 +0000
Subject: [PATCH] feat: run services locally

---
 docs/ecolyo/technical/services/index.md | 24 +++++++++++++++++++++++-
 mkdocs.yml                              |  2 +-
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/docs/ecolyo/technical/services/index.md b/docs/ecolyo/technical/services/index.md
index 836506a..364c685 100644
--- a/docs/ecolyo/technical/services/index.md
+++ b/docs/ecolyo/technical/services/index.md
@@ -21,4 +21,26 @@ File location is determined after the build, see [here](https://forge.grandlyon.
 
 ## Ecolyo services
 
-Service code are located under ``src\targets\services``.
+Service code are located under `src\targets\services`.
+
+## Run services
+
+### On alpha
+
+To run services on alpha, a script `get_instance_triggers.sh` allows you to get triggers associated with services. You can find the corresponding service by looking at the trigger frequency and comparing it with our [manifest.webapp](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/ecolyo/-/blob/dev/manifest.webapp#L171).
+
+Then you need to run the script `launch_instance_trigger.sh`.
+
+### Locally
+
+To run services on a local dev environment, you need to run a build first.
+
+Then you need to run :
+
+```sh
+yarn run cozy-konnector-dev -m manifest.webapp <service.js>
+# example
+yarn run cozy-konnector-dev -m manifest.webapp ./build/services/enedisHalfHourMonthlyAnalysis/ecolyo.js
+```
+
+More details on the [cozy docs / Services / Execution](https://docs.cozy.io/en/howTos/dev/services/#execution).
diff --git a/mkdocs.yml b/mkdocs.yml
index 8eee055..b806518 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -76,7 +76,7 @@ nav:
           - Remote Doctypes: ecolyo/technical/remote_doctypes.md
           - Scaffolding: ecolyo/technical/scaffolding.md
           - Services:
-              - Description: ecolyo/technical/services/index.md
+              - Introduction: ecolyo/technical/services/index.md
               - Monthly report notification: ecolyo/technical/services/monthly_report_notification.md
               - Aggregator usage events: ecolyo/technical/services/aggregator_usage_events.md
               - Consumption Alert: ecolyo/technical/services/consumption_alert.md
-- 
GitLab