From 6261d51c907f709283975e49896fb35484efc530 Mon Sep 17 00:00:00 2001
From: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date: Wed, 6 Oct 2021 11:25:29 +0200
Subject: [PATCH] allow specifying publik packages version (#57656)

---
 install_source.yml              | 4 ++--
 roles/authentic/tasks/main.yml  | 1 +
 roles/base/tasks/main.yml       | 6 ++++++
 roles/bijoe/tasks/main.yml      | 2 ++
 roles/chrono/tasks/main.yml     | 1 +
 roles/combo/tasks/main.yml      | 1 +
 roles/fargo/tasks/main.yml      | 1 +
 roles/hobo/tasks/main.yml       | 1 +
 roles/passerelle/tasks/main.yml | 1 +
 roles/wcs/tasks/main.yml        | 2 ++
 roles/welco/tasks/main.yml      | 1 +
 tasks/install_theme.yml         | 2 ++
 12 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/install_source.yml b/install_source.yml
index b64e544..a59f1af 100644
--- a/install_source.yml
+++ b/install_source.yml
@@ -2,7 +2,7 @@
   git:
     repo: "ssh://git@git.entrouvert.org/{{ repo }}.git"
     dest: "{{ repo_dir }}"
-    version: main
+    version: "{{version}}"
   when:
     - git_ssh
     - clone_repo
@@ -11,7 +11,7 @@
   git:
     repo: "https://repos.entrouvert.org/{{ repo }}.git"
     dest: "{{ repo_dir }}"
-    version: main
+    version: "{{version}}"
   when:
     - not git_ssh
     - clone_repo
diff --git a/roles/authentic/tasks/main.yml b/roles/authentic/tasks/main.yml
index 899e829..bf68840 100644
--- a/roles/authentic/tasks/main.yml
+++ b/roles/authentic/tasks/main.yml
@@ -9,6 +9,7 @@
   vars:
     repo: "authentic"
     repo_dir: "{{ src_dir }}/authentic"
+    version: "{{authentic_version|default('main')}}"
 
 - name: Remove /etc/authentic-multitenant
   file:
diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml
index f3b7e4c..d3d9878 100644
--- a/roles/base/tasks/main.yml
+++ b/roles/base/tasks/main.yml
@@ -124,6 +124,7 @@
     repo: "eopayment"
     repo_dir: "{{ src_dir }}/eopayment"
     virtualenv: "{{venv_py3}}"
+    version: "{{eopayment_version|default('main')}}"
 
 - name: source install django-tenant-schemas
   include_tasks: install_source.yml
@@ -131,6 +132,7 @@
     repo: "debian/django-tenant-schemas"
     repo_dir: "{{ src_dir }}/django-tenant-schemas"
     virtualenv: "{{venv_py3}}"
+    version: "{{django_tenant_schemas_version|default('main')}}"
 
 - name: source install django-mellon
   include_tasks: install_source.yml
@@ -138,6 +140,7 @@
     repo: "django-mellon"
     repo_dir: "{{ src_dir }}/django-mellon"
     virtualenv: "{{venv_py3}}"
+    version: "{{django_mellon_version|default('main')}}"
 
 - name: source install gadjo
   include_tasks: install_source.yml
@@ -145,6 +148,7 @@
     repo: "gadjo"
     repo_dir: "{{ src_dir }}/gadjo"
     virtualenv: "{{venv_py3}}"
+    version: "{{gadjo_version|default('main')}}"
 
 - name: install python-memcached
   pip:
@@ -157,11 +161,13 @@
     repo: "debian/django-ckeditor"
     repo_dir: "{{ src_dir }}/django-ckeditor"
     virtualenv: "{{venv_py3}}"
+    version: "{{django_ckeditor_version|default('main')}}"
 
 - name: install theme
   import_tasks: tasks/install_theme.yml
   vars:
     src_theme_dir: "{{src_dir}}/{{theme_repo}}"
+    version: "{{publik_base_theme_version|default('main')}}"
   tags:
     - theme
 
diff --git a/roles/bijoe/tasks/main.yml b/roles/bijoe/tasks/main.yml
index 3fbd534..20a8294 100644
--- a/roles/bijoe/tasks/main.yml
+++ b/roles/bijoe/tasks/main.yml
@@ -4,12 +4,14 @@
   vars:
     repo: "bijoe"
     repo_dir: "{{ src_dir }}/bijoe"
+    version: "{{bijoe_version|default('main')}}"
 
 - name: source install wcs-olap
   import_tasks: install_source.yml
   vars:
     repo: "wcs-olap"
     repo_dir: "{{ src_dir }}/wcs-olap"
+    version: "{{wcs_olap_version|default('main')}}"
 
 - name: bijoe app setup
   import_role:
diff --git a/roles/chrono/tasks/main.yml b/roles/chrono/tasks/main.yml
index 7336f52..304a359 100644
--- a/roles/chrono/tasks/main.yml
+++ b/roles/chrono/tasks/main.yml
@@ -4,6 +4,7 @@
   vars:
     repo: "chrono"
     repo_dir: "{{ src_dir }}/chrono"
+    version: "{{chrono_version|default('main')}}"
 
 - name: chrono app setup
   import_role:
diff --git a/roles/combo/tasks/main.yml b/roles/combo/tasks/main.yml
index 3756d7a..c8ad555 100644
--- a/roles/combo/tasks/main.yml
+++ b/roles/combo/tasks/main.yml
@@ -3,6 +3,7 @@
   vars:
     repo: "combo"
     repo_dir: "{{ src_dir }}/combo"
+    version: "{{combo_version|default('main')}}"
 
 - name: combo app setup
   import_role:
diff --git a/roles/fargo/tasks/main.yml b/roles/fargo/tasks/main.yml
index 4042aeb..b55f78c 100644
--- a/roles/fargo/tasks/main.yml
+++ b/roles/fargo/tasks/main.yml
@@ -4,6 +4,7 @@
   vars:
     repo: "fargo"
     repo_dir: "{{ src_dir }}/fargo"
+    version: "{{fargo_version|default('main')}}"
 
 - name: fargo app setup
   import_role:
diff --git a/roles/hobo/tasks/main.yml b/roles/hobo/tasks/main.yml
index 57cc015..bffcd32 100644
--- a/roles/hobo/tasks/main.yml
+++ b/roles/hobo/tasks/main.yml
@@ -4,6 +4,7 @@
     repo: "hobo"
     repo_dir: "{{ src_dir }}/hobo"
     virtualenv: "{{venv_py3}}"
+    version: "{{hobo_version|default('main')}}"
 
 - name: hobo app setup
   import_role:
diff --git a/roles/passerelle/tasks/main.yml b/roles/passerelle/tasks/main.yml
index cb9b51a..a91b0ee 100644
--- a/roles/passerelle/tasks/main.yml
+++ b/roles/passerelle/tasks/main.yml
@@ -3,6 +3,7 @@
   vars:
     repo: "passerelle"
     repo_dir: "{{ src_dir }}/passerelle"
+    version: "{{passerelle_version|default('main')}}"
 
 - name: passerelle app setup
   import_role:
diff --git a/roles/wcs/tasks/main.yml b/roles/wcs/tasks/main.yml
index 6cbdac5..0467de0 100644
--- a/roles/wcs/tasks/main.yml
+++ b/roles/wcs/tasks/main.yml
@@ -15,12 +15,14 @@
   vars:
     repo: "wcs"
     repo_dir: "{{ src_dir }}/wcs"
+    version: "{{wcs_version|default('main')}}"
 
 - name: source install auquotidien
   import_tasks: install_source.yml
   vars:
     repo: "auquotidien"
     repo_dir: "{{ src_dir }}/auquotidien"
+    version: "{{auquotidien_version|default('main')}}"
 
 - name: "settings directory"
   file:
diff --git a/roles/welco/tasks/main.yml b/roles/welco/tasks/main.yml
index 0966cc0..a0f895e 100644
--- a/roles/welco/tasks/main.yml
+++ b/roles/welco/tasks/main.yml
@@ -4,6 +4,7 @@
   vars:
     repo: "welco"
     repo_dir: "{{ src_dir }}/welco"
+    version: "{{welco_version|default('main')}}"
 
 - name: welco app setup
   import_role:
diff --git a/tasks/install_theme.yml b/tasks/install_theme.yml
index 890e1c3..cf80250 100644
--- a/tasks/install_theme.yml
+++ b/tasks/install_theme.yml
@@ -3,6 +3,7 @@
   git:
     repo: ssh://git@git.entrouvert.org/{{theme_repo}}.git
     dest: "{{src_theme_dir}}"
+    version: "{{version}}"
   when:
     - git_ssh
     - clone_repo
@@ -11,6 +12,7 @@
   git:
     repo: https://repos.entrouvert.org/{{theme_repo}}.git
     dest: "{{src_theme_dir}}"
+    version: "{{version}}"
   when:
     - not git_ssh
     - clone_repo
-- 
2.30.2

