From 98244cd38418ff6923f86012a42a0d8729fa560b Mon Sep 17 00:00:00 2001
From: Rodrigo Goncalves <rodrigo.g@ufsc.br>
Date: Tue, 27 Aug 2024 14:18:38 +0000
Subject: [PATCH] Inclusin of SmartDataContext ingress into docker compose

---
 .gitignore                          |  5 ++++-
 docker-compose.yml                  |  7 +++++++
 docker/ingress/config/jobs.json     |  6 ++++++
 docker/ingress/config/tikiwiki.json | 15 +++++++++++++++
 docker/variables.env                |  7 +++++++
 5 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 docker/ingress/config/jobs.json
 create mode 100644 docker/ingress/config/tikiwiki.json

diff --git a/.gitignore b/.gitignore
index 86846f5..1beafc8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,4 +15,7 @@ prometheus/
 wavs/
 zips/
 /dev-certificates
-.idea
\ No newline at end of file
+.idea
+/docker/ingress/config/*.crt
+/docker/ingress/config/*.pem
+/docker/ingress/config/*.key
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
index 3c3b63a..c5c2de9 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -68,6 +68,13 @@ services:
       build: ./context/
       env_file:
         - docker/variables.env
+
+    smartdata-context-ingress:
+      build: ./ingress/
+      env_file:
+        - docker/variables.env
+      volumes:
+        - ./docker/ingress/config:/app/config
 volumes:
   certificates:
   mariadb:
diff --git a/docker/ingress/config/jobs.json b/docker/ingress/config/jobs.json
new file mode 100644
index 0000000..4865cd4
--- /dev/null
+++ b/docker/ingress/config/jobs.json
@@ -0,0 +1,6 @@
+{
+  "import-tikiwiki-test": {
+    "command": "tikiwiki-import test",
+    "schedule": "* * * * *"
+  }
+}
\ No newline at end of file
diff --git a/docker/ingress/config/tikiwiki.json b/docker/ingress/config/tikiwiki.json
new file mode 100644
index 0000000..5b3a821
--- /dev/null
+++ b/docker/ingress/config/tikiwiki.json
@@ -0,0 +1,15 @@
+{
+  "domains": {
+    "test" : {
+      "certificate": "./config/test.crt",
+      "key": "./config/test.key",
+      "api": "https://172.18.0.1",
+      "trackers": {
+        "vehicleList": "Vehicle List",
+        "vehicleMaintenancePlan": "Vehicle Maintenance Plan",
+        "vehicleMaintenanceReport": "Vehicle Maintenance Report",
+        "vehicleMaintenanceReportErrorCodes": "Vehicle Failure"
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/docker/variables.env b/docker/variables.env
index 730ca1e..6c9cb99 100644
--- a/docker/variables.env
+++ b/docker/variables.env
@@ -23,3 +23,10 @@ MONGO_USERNAME=smartdatacontext
 MONGO_PASSWORD=smartdatacontext
 MONGO_DATABASE=smartdatacontext
 MONGO_HOST=mongo
+
+# TikiWiki
+TIKIWIKIDB_HOST=172.18.0.1
+TIKIWIKIDB_PORT=3307
+TIKIWIDB_DATABASE=tikiwiki
+TIKIWIKDB_USERNAME=tikiwiki
+TIKIWIKIDB_PASSWORD=tikiwiki
\ No newline at end of file
-- 
GitLab