Skip to content
Snippets Groups Projects
Unverified Commit f8891cab authored by Olivier MARSOL's avatar Olivier MARSOL Committed by GitHub
Browse files

May add the ability to renew a previously created platform.. or not ! (#30)

* May add the ability to renew a previously created platform.. or not !

* Update 03_application_ref.js.j2

Added one more conditional to bypass apps duplicates.
Better way may be to manage some kind of "insert or update", if new apps are added later.
parent ad13a0c7
No related branches found
No related tags found
No related merge requests found
...@@ -10,3 +10,6 @@ mongodb: ...@@ -10,3 +10,6 @@ mongodb:
mongod_replicaset_name: "shard{{ mongo_shard_id }}" mongod_replicaset_name: "shard{{ mongo_shard_id }}"
mongod_client_connect_timeout_ms: 2000 mongod_client_connect_timeout_ms: 2000
renew_platform: true #either true or false ; if true, most already existing tables will be dropped
...@@ -2,6 +2,7 @@ db = db.getSiblingDB('{{ mongodb.iam.db }}') ...@@ -2,6 +2,7 @@ db = db.getSiblingDB('{{ mongodb.iam.db }}')
print("START 01_iam_ref.js"); print("START 01_iam_ref.js");
{% if renew_platform|lower == 'true' %}
db.users.remove({}); db.users.remove({});
db.groups.remove({}); db.groups.remove({});
db.profiles.remove({}); db.profiles.remove({});
...@@ -13,6 +14,7 @@ db.sequences.remove({}); ...@@ -13,6 +14,7 @@ db.sequences.remove({});
db.tokens.remove({}); db.tokens.remove({});
db.createCollection('events'); db.createCollection('events');
db.createCollection('operations'); db.createCollection('operations');
{% endif %}
// ========================================= CUSTOMERS ========================================= // ========================================= CUSTOMERS =========================================
......
db = db.getSiblingDB('{{ mongodb.iam.db }}') db = db.getSiblingDB('{{ mongodb.iam.db }}')
{% if renew_platform|lower == 'true' %}
db.applications.remove({}); db.applications.remove({});
{% endif %}
{% if renew_platform|lower == 'true' %}
db.applications.insert({ db.applications.insert({
"identifier" : "CUSTOMERS_APP", "identifier" : "CUSTOMERS_APP",
{% if vitamui.identity_admin.base_url is defined %} {% if vitamui.identity_admin.base_url is defined %}
...@@ -123,3 +126,4 @@ db.applications.insert({ ...@@ -123,3 +126,4 @@ db.applications.insert({
"tooltip": "Consulter mes informations, Choisir la langue de l'interface", "tooltip": "Consulter mes informations, Choisir la langue de l'interface",
"target": "_self" "target": "_self"
}); });
{% endif %}
...@@ -2,8 +2,10 @@ db = db.getSiblingDB('{{ mongodb.security.db }}') ...@@ -2,8 +2,10 @@ db = db.getSiblingDB('{{ mongodb.security.db }}')
print("START 02_security_ref.js"); print("START 02_security_ref.js");
{% if renew_platform|lower == 'true' %}
db.contexts.remove({}); db.contexts.remove({});
db.createCollection('events'); db.createCollection('events');
{% endif %}
db.contexts.insert({ db.contexts.insert({
"_id": "cas_context", "_id": "cas_context",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment