If you somehow find yourself in a situation, when you need to run multiple CzechIdM instances for development (for example when testing CzechIdM's cloud capabilities), you may consider doing this using you IDE as it provides you some neat advantages over running separate virtual machines:
Prerequisities:
In order tu run second tomcat instance from Idea, you need to start it on a different port. This can be done by copying current tomcat running configuration and tweaking some of its settings.
You need to change two options:
-Didm.pub.app.instanceId=idm-secondary -Didm.pub.security.allowed-origins=http://localhost:3002,http://localhost
There is nothing to it. You just select configuration, which you want to run, and pres play button next to it (or a bug, if you want to run it in debug). Note that event though it should not matter, it is safer to run one configuration, wait untill it is completely started and then run second one.
In order to run second frontend for developer purposes (using gulp watch) we need to point it to our newly created instance, which is running on port 8081. You can do it by providing second configuration file and running it in a second terminal window.
You can do it by copying existing configuration
cd czechidm-app mkdir config/default-secondary cp config/default/development.json config/default-secondary/
Now you need to edit config/default-secondary/development.json file and replace
... "env": "development", "serverUrl": "http://localhost:8080/idm-backend/api/v1", "theme": "czechidm-core/themes/default", ...
with
... "env": "development", "serverUrl": "http://localhost:8081/idm-backend/api/v1", "theme": "czechidm-core/themes/default", ...
In order to start frontend, you should run this command
gulp -p default --stage development
for first instance (comunicating with tomcat at port 8080)
gulp -p default-secondary --stage development
for second instance (comunicating with tomcat at port 8081)
In order to vreify, that everything works, log in to both UIs and check that they have correct instance-id (Settings→Configuration) and that if you for example create new user in one instance, you can see it in the other one.