diff options
-rw-r--r-- | .env | 2 | ||||
-rw-r--r-- | README.md | 15 | ||||
-rwxr-xr-x[-rw-r--r--] | config/pe/push-policies.sh | 6 | ||||
-rw-r--r-- | docker-compose-integration.yml | 4 | ||||
-rw-r--r-- | docker-compose.yml | 4 |
5 files changed, 29 insertions, 2 deletions
@@ -0,0 +1,2 @@ +PRELOAD_POLICIES=true + @@ -12,6 +12,14 @@ To build it using Maven 3, first build 'policy/common', 'policy/engine', 'policy target/policy-pe target/policy-drools +For example: +docker build -t onap/policy/policy-os policy-os +docker build -t onap/policy/policy-db policy-db +docker build -t onap/policy/policy-nexus policy-nexus +docker build -t onap/policy/policy-base policy-base +docker build -t onap/policy/policy-pe target/policy-pe +docker build -t onap/policy/policy-drools target/policy-drools + In addition, the 'config' directory contains configuration files that are read during the startup of the containers; this directory is referenced by the docker-compose.yml file. If you want to call the docker-compose, the following needs to be setup before doing so: @@ -19,3 +27,10 @@ If you want to call the docker-compose, the following needs to be setup before d chmod +x config/drools/drools-tweaks.sh IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2) echo $IP_ADDRESS > config/pe/ip_addr.txt + +If you do not want the policies pre-loaded, then set this environment variable to false: + +export PRELOAD_POLICIES=false + +It will override the settings in the .env file. Which is set to true. + diff --git a/config/pe/push-policies.sh b/config/pe/push-policies.sh index 77f94c0f..d50706de 100644..100755 --- a/config/pe/push-policies.sh +++ b/config/pe/push-policies.sh @@ -12,6 +12,12 @@ sleep 2 curl -v --silent -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -F "file=@cl-amsterdam-template.drl" -F "importParametersJson={\"serviceName\":\"ClosedLoopControlName\",\"serviceType\":\"BRMSPARAM\"}" 'http://pdp:8081/pdp/api/policyEngineImport' +echo "PRELOAD_POLICIES is $PRELOAD_POLICIES" + +if [ "$PRELOAD_POLICIES" == "false" ]; then + exit 0 +fi + #########################################Create BRMS Param policies########################################## echo "Create BRMSParam Operational Policies" diff --git a/docker-compose-integration.yml b/docker-compose-integration.yml index 5d1056c8..042971d2 100644 --- a/docker-compose-integration.yml +++ b/docker-compose-integration.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3' services: mariadb: image: onap/policy/policy-db @@ -12,6 +12,8 @@ services: hostname: nexus pap: image: onap/policy/policy-pe + environment: + - PRELOAD_POLICIES=${PRELOAD_POLICIES} container_name: pap depends_on: - mariadb diff --git a/docker-compose.yml b/docker-compose.yml index 2de9ffe5..6091dd93 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3' networks: default: driver: bridge @@ -17,6 +17,8 @@ services: hostname: nexus pap: image: onap/policy/policy-pe + environment: + - PRELOAD_POLICIES=${PRELOAD_POLICIES} container_name: pap depends_on: - mariadb |