Release version 1.13.7
[sdc.git] / utils / webseal-simulator / README.md
1 # SDC Simulator
2
3 This options is for developers to run locally SDC
4 SDC Simulator is a project that enables emulation of web server that provides security policy and sign-on to the SDC component in dev environments.
5
6   - Provides sign on to the basic user roles/functionalities
7   - Creation of basic user accounts
8
9 # Docker compilation - Docker Maven Build Profile (io.fabric8 maven Plugin)
10
11 If you are using onap vagrant you can deploy the simulator by:
12
13 Set up the DOCKER_HOST environmental variable
14
15 To set environmental variable in Windows (the docker engine environment):
16 - Run `cmd`
17 -- Issue command `set NAME=VAL
18 Example: set DOCKER_HOST=tcp://127.0.0.1:2375
19 --To check if the variable set succeeded issue `echo %DOCKER_HOST%`
20
21 - To compile sdc-simulator docker:
22 1. Run `mvn clean install -Ddocker.buildArg.http_proxy=<http_proxy> -Ddocker.buildArg.https_proxy=<https_proxy> -P docker`
23 -- The proxy arguments are passed and used as environmental variables in Dockerfiles 
24 2. Copy the script /webseal-simulator/scripts/simulator_docker_run.sh to the docker engine environment and run:
25 `simulator_docker_run.sh -r 1.1-STAGING-latest`
26 3. Run `docker ps` to verify that sdc-simulator docker is up and running.
27 4. Enter to UI: `http://<ip address>:8285/login`
28
29 # Docker compilation - Docker Engine
30
31 1. Build web simulator WAR file: run `mvn clean install` on project “webseal simulator”. This will generate war file (WSSimulator.war) in the target folder.
32 2. Ftp war file: webseal-simulator/sdc-simulator folder to your localhost vagrant machine which runs docker engine daemon.
33 -- Check that WSSimulator.war exists after first step No.1 in webseal-simulator/sdc-simulator folder.
34 3. Run `docker build -t openecomp/sdc-simulator:1.1-STAGING-latest <PATH/sdc-simulator>`
35 Example: docker build -t openecomp/sdc-simulator:1.1-STAGING-latest /tmp/docker/sdc-simulator/
36 -- If running behind a proxy:
37 `docker build --build-arg http_proxy=http://URL:PORT --build-arg https_proxy=http://URL:PORT -t openecomp/sdc-simulator:1.1-STAGING-latest /tmp/docker/sdc-simulator/`
38 4. Validate that images pushed to the local repo by executing `docker images`
39 5. Copy the script /webseal-simulator/scripts/simulator_docker_run.sh to the docker engine environment and run: `simulator_docker_run.sh -r 1.1-STAGING-latest`
40 6. Run `docker ps` to verify that sdc-simulator docker is up and running.
41 7. Enter to UI: `http://<ip address>:8285/login`
42
43 # WAR compilation
44
45   - To compile WSSimulator.war:
46 1. Build web simulator WAR file: run `mvn clean install` on project "webseal simulator". This will generate war file (WSSimulator.war) in the target folder.
47 2. Ftp war file: webseal-simulator\target\WSSimulator.war to your localhost vagrant machine: /home/vagrant/webseal-simulator/webapps folder
48 3. Ftp configuration file: webseal-simulator\src\main\resources\webseal.conf to your localhost vagrant machine: /home/vagrant/webseal-simulator/config
49 4. Add users to simulator: open configuration file - webseal.conf and add new user to the user list.
50    Note: You need to define the user in the SDC as well.
51 5. To run the simulator, enter to your local vagrant and run: startWebsealSimulator.sh
52 -- Restart the simulator:
53    Stop the simulator: stopWebsealSimulator.sh
54    Start the simulator: startWebsealSimulator.sh
55 6. Enter to UI: http://<ip address>:8285/login