Skip to content

Commit

Permalink
Merge branch '2.1.0.release' ci_latest
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGuironnetRTE committed Feb 22, 2021
2 parents f87dd74 + 034d011 commit 47b43b5
Show file tree
Hide file tree
Showing 267 changed files with 3,856 additions and 2,914 deletions.
3 changes: 2 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ cd operatorfabric-core
. Launch our demo docker-compose file
+
----
./config/docker/docker-compose.sh
cd ./config/docker
./docker-compose.sh
----

. After a little while, log into the application UI at *localhost:2002/ui/* using admin/test as credentials.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0.RELEASE
2.1.0.RELEASE
6 changes: 3 additions & 3 deletions bin/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ startProject(){
cd $OF_HOME
java -Xss512k -XX:MaxRAM=512m $debugOptions \
-jar $projectBuildPath/libs/$1-$version.jar \
$applicationOptions 2>&1 > $projectBuildPath/logs/$(date -I).log &
$applicationOptions 2>&1 > $projectBuildPath/logs/$(date \+"%y-%m-%d").log &
# set +x
echo $! > $projectBuildPath/PIDFILE

Expand Down Expand Up @@ -166,7 +166,7 @@ stopCommand(){
for ((i=0; i<${#dependentProjects[*]}; ));
do
stopProject ${dependentProjects[i]} ${dependentProjects[i+1]}
i=$((i+"$PRJ_STRC_FIELDS"))
i=$((i+$PRJ_STRC_FIELDS))
done
}

Expand All @@ -192,7 +192,7 @@ hardstopCommand(){
for ((i=0; i<${#dependentProjects[*]}; ));
do
hardstopProject ${dependentProjects[i]} ${dependentProjects[i+1]}
i=$((i+"$PRJ_STRC_FIELDS"))
i=$((i+$PRJ_STRC_FIELDS))
done
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* Copyright (c) 2018-2021, RTE (http://www.rte-france.com)
* See AUTHORS.txt
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* SPDX-License-Identifier: MPL-2.0
* This file is part of the OperatorFabric project.
*/

package org.lfenergy.operatorfabric.businessconfig.model;

/**
* Type of state
* <dl>
* <dt>INPROGRESS</dt><dd>In progress</dd>
* <dt>FINISHED</dt><dd>Finished</dd>
* <dt>CANCELED</dt><dd>Canceled</dd>
* </dl>
* Note : This enum is created by hand because Swagger can't handle enums. It should match the corresponding
* enum definition in the Cards API.
*
*
*/
public enum TypeOfStateEnum {
INPROGRESS, FINISHED, CANCELED
}

1 change: 1 addition & 0 deletions client/businessconfig/src/main/modeling/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"ActionEnum": "org.lfenergy.operatorfabric.businessconfig.model.ActionEnum",
"ResponseBtnColorEnum": "org.lfenergy.operatorfabric.businessconfig.model.ResponseBtnColorEnum",
"LinkTypeEnum": "org.lfenergy.operatorfabric.businessconfig.model.LinkTypeEnum",
"TypeOfStateEnum": "org.lfenergy.operatorfabric.businessconfig.model.TypeOfStateEnum",
"EpochDate": "java.time.Instant",
"LongInteger": "java.lang.Long"
}
Expand Down
4 changes: 2 additions & 2 deletions config/dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
- "89:8080"
- "90:9990"
web-ui:
image: "lfeoperatorfabric/of-web-ui:2.0.0.RELEASE"
image: "lfeoperatorfabric/of-web-ui:2.1.0.RELEASE"
#user: ${USER_ID}:${USER_GID}
ports:
- "2002:80"
Expand All @@ -38,6 +38,6 @@ services:
- "./nginx.conf:/etc/nginx/conf.d/default.conf"
- "./loggingResults:/etc/nginx/html/logging"
ext-app:
image: "lfeoperatorfabric/of-external-app:2.0.0.RELEASE"
image: "lfeoperatorfabric/of-external-app:2.1.0.RELEASE"
ports:
- "8090:8090"
70 changes: 1 addition & 69 deletions config/dev/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -111,75 +111,7 @@ server {
proxy_pass http://${MY_DOCKER_HOST}:2103/users;
}

location ~ "^/users/(.*)" {
# enables `ng serve` mode
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' '*';
add_header 'Access-Control-Allow-Headers' '*';
add_header 'Content-Length' 0;
add_header 'Vary' 'Origin';
add_header 'Vary' 'Access-Control-Request-Method' ;
add_header 'Vary' 'Access-Control-Request-Headers';
return 204;
}
proxy_set_header Host $http_host;
proxy_pass http://${MY_DOCKER_HOST}:2103/$1;
}

location /groups {
# enables `ng serve` mode
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' '*';
add_header 'Access-Control-Allow-Headers' '*';
add_header 'Content-Length' 0;
add_header 'Vary' 'Origin';
add_header 'Vary' 'Access-Control-Request-Method' ;
add_header 'Vary' 'Access-Control-Request-Headers';
return 204;
}
proxy_set_header Host $http_host;
proxy_pass http://${MY_DOCKER_HOST}:2103/groups;
}

location ~ "^/groups/(.*)" {
# enables `ng serve` mode
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' '*';
add_header 'Access-Control-Allow-Headers' '*';
add_header 'Content-Length' 0;
add_header 'Vary' 'Origin';
add_header 'Vary' 'Access-Control-Request-Method' ;
add_header 'Vary' 'Access-Control-Request-Headers';
return 204;
}
proxy_set_header Host $http_host;
proxy_pass http://${MY_DOCKER_HOST}:2103/$1;
}

location /entities {
# enables `ng serve` mode
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' '*';
add_header 'Access-Control-Allow-Headers' '*';
add_header 'Content-Length' 0;
add_header 'Vary' 'Origin';
add_header 'Vary' 'Access-Control-Request-Method' ;
add_header 'Vary' 'Access-Control-Request-Headers';
return 204;
}
proxy_set_header Host $http_host;
proxy_pass http://${MY_DOCKER_HOST}:2103/entities;
}

location ~ "^/entities/(.*)" {
location ~ "^/users/(.*)" {
# enables `ng serve` mode
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
Expand Down
2 changes: 2 additions & 0 deletions config/dev/web-ui.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"title": "OperatorFabric (Dev Mode)",
"environmentName": "DEV ENV",
"environmentColor": "green",
"checkPerimeterForResponseCard": true,
"archive": {
"filters": {
Expand Down
14 changes: 14 additions & 0 deletions config/docker/docker-compose.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
#!/bin/bash

echo "Usage: "
echo " 1: ./docker-compose.sh"
echo " 2: ./docker-compose.sh <pathToExternalEnvironmentFile>"

echo USER_ID="$(id -u)" > .env
echo USER_GID="$(id -g)" >> .env
# create directory for bundle storage if not existing
mkdir -p businessconfig-storage
if [ "$#" -eq 0 ]; then
echo CONFIG_PATH=./ >> .env
echo SPRING_PROFILES_ACTIVE=docker >> .env
else
EXTERNAL_CONFIGURATION_FILE=$1
CONFIG_PATH=$(dirname "$1")
cat ${EXTERNAL_CONFIGURATION_FILE} >> .env
echo CONFIG_PATH="$CONFIG_PATH" >> .env
fi
cat .env
docker-compose up -d
24 changes: 18 additions & 6 deletions config/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,59 +28,71 @@ services:
# - "90:9990"
users:
container_name: users
image: "lfeoperatorfabric/of-users-business-service:2.0.0.RELEASE"
image: "lfeoperatorfabric/of-users-business-service:2.1.0.RELEASE"
user: ${USER_ID}:${USER_GID}
ports:
- "2103:8080"
# Debug port closed for security reasons, be careful if you open it
# - "4103:5005"
environment:
- SPRING_PROFILES_ACTIVE
volumes:
- "../certificates:/certificates_to_add"
- "./users-docker.yml:/config/application.yml"
- "./common-docker.yml:/config/common-docker.yml"
- ${CONFIG_PATH}:/external-config
businessconfig:
container_name: businessconfig
image: "lfeoperatorfabric/of-businessconfig-business-service:2.0.0.RELEASE"
image: "lfeoperatorfabric/of-businessconfig-business-service:2.1.0.RELEASE"
depends_on:
- mongodb
user: ${USER_ID}:${USER_GID}
ports:
- "2100:8080"
# Debug port closed for security reasons, be careful if you open it
# - "4100:5005"
environment:
- SPRING_PROFILES_ACTIVE
volumes:
- "../certificates:/certificates_to_add"
- "./businessconfig-storage:/businessconfig-storage"
- "./common-docker.yml:/config/common-docker.yml"
- "./businessconfig-docker.yml:/config/application-docker.yml"
- ${CONFIG_PATH}:/external-config
cards-publication:
container_name: cards-publication
image: "lfeoperatorfabric/of-cards-publication-business-service:2.0.0.RELEASE"
image: "lfeoperatorfabric/of-cards-publication-business-service:2.1.0.RELEASE"
depends_on:
- mongodb
user: ${USER_ID}:${USER_GID}
ports:
- "2102:8080"
# Debug port closed for security reasons, be careful if you open it
# - "4102:5005"
environment:
- SPRING_PROFILES_ACTIVE
volumes:
- "../certificates:/certificates_to_add"
- "./common-docker.yml:/config/common-docker.yml"
- "./cards-publication-docker.yml:/config/application-docker.yml"
- ${CONFIG_PATH}:/external-config
cards-consultation:
container_name: cards-consultation
image: "lfeoperatorfabric/of-cards-consultation-business-service:2.0.0.RELEASE"
image: "lfeoperatorfabric/of-cards-consultation-business-service:2.1.0.RELEASE"
user: ${USER_ID}:${USER_GID}
ports:
- "2104:8080"
# Debug port closed for security reasons, be careful if you open it
# - "4104:5005"
environment:
- SPRING_PROFILES_ACTIVE
volumes:
- "../certificates:/certificates_to_add"
- "./common-docker.yml:/config/common-docker.yml"
- "./cards-consultation-docker.yml:/config/application-docker.yml"
- ${CONFIG_PATH}:/external-config
web-ui:
image: "lfeoperatorfabric/of-web-ui:2.0.0.RELEASE"
image: "lfeoperatorfabric/of-web-ui:2.1.0.RELEASE"
ports:
- "2002:80"
depends_on:
Expand All @@ -93,6 +105,6 @@ services:
- "./nginx.conf:/etc/nginx/conf.d/default.conf"
ext-app:
# External application example, must not be activated in production mode
image: "lfeoperatorfabric/of-external-app:2.0.0.RELEASE"
image: "lfeoperatorfabric/of-external-app:2.1.0.RELEASE"
ports:
- "8090:8090"
68 changes: 0 additions & 68 deletions config/docker/nginx-cors-permissive.conf
Original file line number Diff line number Diff line change
Expand Up @@ -127,74 +127,6 @@ server {
proxy_pass http://users:8080/users;
}

location /groups {
# enables `ng serve` mode
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' '*';
add_header 'Access-Control-Allow-Headers' '*';
add_header 'Content-Length' 0;
add_header 'Vary' 'Origin';
add_header 'Vary' 'Access-Control-Request-Method' ;
add_header 'Vary' 'Access-Control-Request-Headers';
return 204;
}
proxy_set_header Host $http_host;
proxy_pass http://users:8080/groups;
}

location ~ "^/groups/(.*)" {
# enables `ng serve` mode
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' '*';
add_header 'Access-Control-Allow-Headers' '*';
add_header 'Content-Length' 0;
add_header 'Vary' 'Origin';
add_header 'Vary' 'Access-Control-Request-Method' ;
add_header 'Vary' 'Access-Control-Request-Headers';
return 204;
}
proxy_set_header Host $http_host;
proxy_pass http://users:8080/$1;
}

location /entities {
# enables `ng serve` mode
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' '*';
add_header 'Access-Control-Allow-Headers' '*';
add_header 'Content-Length' 0;
add_header 'Vary' 'Origin';
add_header 'Vary' 'Access-Control-Request-Method' ;
add_header 'Vary' 'Access-Control-Request-Headers';
return 204;
}
proxy_set_header Host $http_host;
proxy_pass http://users:8080/entities;
}

location ~ "^/entities/(.*)" {
# enables `ng serve` mode
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' '*';
add_header 'Access-Control-Allow-Headers' '*';
add_header 'Content-Length' 0;
add_header 'Vary' 'Origin';
add_header 'Vary' 'Access-Control-Request-Method' ;
add_header 'Vary' 'Access-Control-Request-Headers';
return 204;
}
proxy_set_header Host $http_host;
proxy_pass http://users:8080/$1;
}

location /cards/ {
# enables `ng serve` mode
if ($request_method = 'OPTIONS') {
Expand Down
17 changes: 0 additions & 17 deletions config/docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,6 @@ server {
location ~ "^/users/(.*)" {
proxy_set_header Host $http_host;
proxy_pass http://users:8080/$1;
}
location ~ "^/entities/(.*)" {
proxy_set_header Host $http_host;
proxy_pass http://users:8080/$1;
}
location /entities {
proxy_set_header Host $http_host;
proxy_pass http://users:8080/entities;
}

location ~ "^/groups/(.*)" {
proxy_set_header Host $http_host;
proxy_pass http://users:8080/$1;
}
location /groups {
proxy_set_header Host $http_host;
proxy_pass http://users:8080/groups;
}
location /cards/ {
proxy_set_header Host $http_host;
Expand Down
2 changes: 2 additions & 0 deletions config/docker/web-ui.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"environmentName": "TEST ENV",
"environmentColor": "blue",
"checkPerimeterForResponseCard": true,
"archive": {
"filters": {
Expand Down
Loading

0 comments on commit 47b43b5

Please sign in to comment.