From ae4a935b835c0dc588c7a53aef846dd6506b732f Mon Sep 17 00:00:00 2001 From: Jorge Hernandez Date: Tue, 18 Jul 2017 01:06:39 -0500 Subject: [POLICY-66] self-contained features support installation/enable/disable of self contained package features: Feature 3rd party dependencies, configuration files, and custom installation scripts do not need to be packaged within the policy core base to be used. Change-Id: I35a472e63bd0f9f7aa6cd0c112d41d2b4604a892 Signed-off-by: Jorge Hernandez --- .../src/main/feature/config/logback-eelf.xml | 186 +++++++++++++++++++++ feature-eelf/src/main/feature/install/disable | 33 ++++ feature-eelf/src/main/feature/install/enable | 35 ++++ 3 files changed, 254 insertions(+) create mode 100644 feature-eelf/src/main/feature/config/logback-eelf.xml create mode 100644 feature-eelf/src/main/feature/install/disable create mode 100644 feature-eelf/src/main/feature/install/enable (limited to 'feature-eelf/src/main/feature') diff --git a/feature-eelf/src/main/feature/config/logback-eelf.xml b/feature-eelf/src/main/feature/config/logback-eelf.xml new file mode 100644 index 00000000..7c2725d8 --- /dev/null +++ b/feature-eelf/src/main/feature/config/logback-eelf.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + ${defaultPattern} + + + + + ${logDirectory}/${auditLogName}.log + + ${logDirectory}/${auditLogName}.%i.log.zip + + 1 + 5 + + + 10MB + + + ${defaultAuditPattern} + + + + + + + + + ${logDirectory}/${metricsLogName}.log + + ${logDirectory}/${metricsLogName}.%i.log.zip + + 1 + 5 + + + 15MB + + + ${defaultMetricPattern} + + + + + + + + + + ${logDirectory}/${errorLogName}.log + + ${logDirectory}/${errorLogName}.%i.log.zip + + 1 + 5 + + + ERROR + + + 20MB + + + ${defaultErrorPattern} + + + + + + + + + ${debugLogDirectory}/${debugLogName}.log + + ${debugLogDirectory}/${debugLogName}.%i.log.zip + + 1 + 5 + + + 20MB + + + ${debugPattern} + + + + + + + + + ${logDirectory}/${networkLogName}.log + + logs/network.log.%i.zip + 1 + 5 + + + 15MB + + + ${networkPattern} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/feature-eelf/src/main/feature/install/disable b/feature-eelf/src/main/feature/install/disable new file mode 100644 index 00000000..1eeb090e --- /dev/null +++ b/feature-eelf/src/main/feature/install/disable @@ -0,0 +1,33 @@ +#! /bin/bash + +### +# ============LICENSE_START======================================================= +# ONAP POLICY +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +## + +if [[ "${DEBUG}" == "y" ]]; then + set -x +fi + +SYSTEM_PROPS="${POLICY_HOME}"/config/system.properties + +if [[ -f ${SYSTEM_PROPS} && -r ${SYSTEM_PROPS} ]]; then + if grep -q "^logback.configurationFile=.*$" "${SYSTEM_PROPS}"; then + sed -i -e "s|^logback.configurationFile=.*$|logback.configurationFile=config/logback.xml|" "${SYSTEM_PROPS}" + fi +fi \ No newline at end of file diff --git a/feature-eelf/src/main/feature/install/enable b/feature-eelf/src/main/feature/install/enable new file mode 100644 index 00000000..55a2b99a --- /dev/null +++ b/feature-eelf/src/main/feature/install/enable @@ -0,0 +1,35 @@ +#! /bin/bash + +### +# ============LICENSE_START======================================================= +# ONAP POLICY +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +## + +if [[ "${DEBUG}" == "y" ]]; then + set -x +fi + +SYSTEM_PROPS="${POLICY_HOME}"/config/system.properties + +if [[ -f ${SYSTEM_PROPS} && -r ${SYSTEM_PROPS} ]]; then + if grep -q "^logback.configurationFile=.*$" "${SYSTEM_PROPS}"; then + sed -i -e "s|^logback.configurationFile=.*$|logback.configurationFile=config/logback-eelf.xml|" "${SYSTEM_PROPS}" + else + echo "logback.configurationFile=config/logback-eelf.xml" >> "${SYSTEM_PROPS}" + fi +fi \ No newline at end of file -- cgit 1.2.3-korg