aboutsummaryrefslogtreecommitdiffstats
path: root/lib/policy
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2018-03-13 12:26:08 -0700
committerVictor Morales <victor.morales@intel.com>2018-03-13 12:26:08 -0700
commit4d7590ed7425a94c0f87a8461548c2461d79a710 (patch)
tree083ffc33a4cd6d8eff42deeea1da0b50c49efdfe /lib/policy
parentceb22354fcb078e8991a66dc9bc11dd5f21e77f4 (diff)
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 <victor.morales@intel.com> Issue-ID: INT-441
Diffstat (limited to 'lib/policy')
-rwxr-xr-xlib/policy53
1 files changed, 53 insertions, 0 deletions
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
+}