From 6508de4e252d927962dd3b6191b997e2d2b459b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20NO=C3=8BL?= <tnoel@entrouvert.com>
Date: Fri, 20 May 2022 16:11:19 +0200
Subject: [PATCH] add a Makefile as helper (#65449)

---
 Makefile                      | 30 ++++++++++++++++++++++++++++++
 local-inventory.yml.example   | 34 ++++++++++++++++++++++++++++++++++
 tenants-inventory.yml.example | 17 -----------------
 3 files changed, 64 insertions(+), 17 deletions(-)
 create mode 100644 Makefile
 create mode 100644 local-inventory.yml.example
 delete mode 100644 tenants-inventory.yml.example

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..13b0b84
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,30 @@
+ifneq ("$(wildcard local-inventory.yml)","")
+    INVENTORY ?= local-inventory.yml
+else
+    INVENTORY ?= inventory.yml
+endif
+
+help:
+	@echo ""
+	@echo "make install: install/reinstall a Publik system"
+	@echo "make deploy: deploy a *.dev.publik.love Publik instance"
+	@echo "make renew-certificate: get *.dev.publik.love valid certificate"
+	@echo "make upgrade: pull new Publik code and do all migrations"
+	@echo ""
+	@echo "To use a specific inventory (default is local-inventory.yml or inventory.yml):"
+	@echo "  make INVENTORY=my-inventory.yml ..."
+	@echo ""
+	@echo "More details on https://doc-publik.entrouvert.com/dev/installation-developpeur/"
+	@echo ""
+
+install:
+	ansible-playbook -K -i $(INVENTORY) install.yml
+
+deploy:
+	ansible-playbook -i $(INVENTORY) deploy-tenants.yml
+
+renew-certificate:
+	ansible-playbook -K -i $(INVENTORY) --tags "tls" install.yml
+
+upgrade:
+	ansible-playbook -K -i $(INVENTORY) --tags "source" install.yml
diff --git a/local-inventory.yml.example b/local-inventory.yml.example
new file mode 100644
index 0000000..ccaea10
--- /dev/null
+++ b/local-inventory.yml.example
@@ -0,0 +1,34 @@
+local:
+  hosts:
+    localhost:
+      ansible_connection: local
+      git_ssh: true
+      compile_theme: false
+      # src_dir: "/home/{{user}}/src/entrouvert"
+      # authentic_version: "v3.91"
+      # django_mellon_version: "v1.34"
+      # django_tenant_schemas_version: "v1.9.0.2"
+      # gadjo_version: "v1.46"
+      # bijoe_version: "v1.36"
+      # wcs_olap_version: "v1.58"
+      # chrono_version: "v2.37"
+      # combo_version: "v4.35"
+      # eopayment_version: "v1.76"
+      # hobo_version: "v2.33"
+      # passerelle_version: "v6.27"
+      # wcs_version: "v7.70"
+      # auquotidien_version: "v5.23"
+      # lingo_version: "v0.4"
+      # publik_base_theme_version: "v8.22"
+      # tenants_conf:
+      #   connexion-authentic: "customname-authentic.dev.publik.love"
+      #   agent-combo: "customname-agent-combo.dev.publik.love"
+      #   user-combo: "customname-combo.dev.publik.love"
+      #   dev-hobo: "customname-hobo.dev.publik.love"
+      #   demarches-wcs: "customname-wcs.dev.publik.love"
+      #   dev-passerelle: "customname-passerelle.dev.publik.love"
+      #   dev-fargo: "customname-fargo.dev.publik.love"
+      #   dev-chrono: "customname-chrono.dev.publik.love"
+      #   dev-lingo: "customname-lingo.dev.publik.love"
+      #   dev-bijoe: "customname-bijoe.dev.publik.love"
+      #   dev-welco: "customname-welco.dev.publik.love"
diff --git a/tenants-inventory.yml.example b/tenants-inventory.yml.example
deleted file mode 100644
index a6c002a..0000000
--- a/tenants-inventory.yml.example
+++ /dev/null
@@ -1,17 +0,0 @@
-
-local:
-  hosts:
-    localhost:
-      ansible_connection: local
-      tenants_conf:
-        connexion-authentic: "customname-authentic.dev.publik.love"
-        agent-combo: "customname-agent-combo.dev.publik.love"
-        user-combo: "customname-combo.dev.publik.love"
-        dev-hobo: "customname-hobo.dev.publik.love"
-        demarches-wcs: "customname-wcs.dev.publik.love"
-        dev-passerelle: "customname-passerelle.dev.publik.love"
-        dev-fargo: "customname-fargo.dev.publik.love"
-        dev-chrono: "customname-chrono.dev.publik.love"
-        dev-bijoe: "customname-bijoe.dev.publik.love"
-        dev-welco: "customname-welco.dev.publik.love"
-
-- 
2.35.1

