From 4d7590ed7425a94c0f87a8461548c2461d79a710 Mon Sep 17 00:00:00 2001 From: Victor Morales Date: Tue, 13 Mar 2018 12:26:08 -0700 Subject: Migrate vagrant-onap to devtool repo This change covers the migration of the vagrant-onap tool's code which was located under integration repo to devtool's repository. The tool was renamed to avoid misunderstandings about its goals. Change-Id: I79df8c35fccaa266a789217d441a6cf1183bd42a Signed-off-by: Victor Morales Issue-ID: INT-441 --- lib/policy | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 lib/policy (limited to 'lib/policy') diff --git a/lib/policy b/lib/policy new file mode 100755 index 0000000..1e633be --- /dev/null +++ b/lib/policy @@ -0,0 +1,53 @@ +#!/bin/bash + +source /var/onap/functions + +# _build_policy_images() - Function that build Policy docker images from source code +function _build_policy_images { + compile_src ${src_folders[policy]}/docker + pushd ${src_folders[policy]}/docker + install_maven + mvn prepare-package + cp -r target/policy-pe/* policy-pe/ + cp -r target/policy-drools/* policy-drools + install_docker + bash docker_verify.sh + popd +} + +# get_policy_images() - Function that retrieves Policy docker images +function get_policy_images { + if [[ "$build_image" == "True" ]]; then + _build_policy_images + else + for image in db pe drools nexus; do + pull_onap_image policy/policy-$image onap/policy/policy-$image:latest + done + fi +} + +# install_policy() - Function that clones and installs the Policy services from source code +function install_policy { + pushd ${src_folders[policy]}/docker + chmod +x config/drools/drools-tweaks.sh + echo $IP_ADDRESS > config/pe/ip_addr.txt + run_docker_compose . + popd +} + +# init_policy() - Function that initialize Policy services +function init_policy { + if [[ "$clone_repo" == "True" ]]; then + clone_repos "policy" + if [[ "$compile_repo" == "True" ]]; then + compile_repos "policy" + fi + fi + + if [[ "$skip_get_images" == "False" ]]; then + get_policy_images + if [[ "$skip_install" == "False" ]]; then + install_policy + fi + fi +} -- cgit 1.2.3-korg