summaryrefslogtreecommitdiffstats
path: root/lib/vid
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/vid
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/vid')
-rwxr-xr-xlib/vid49
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/vid b/lib/vid
new file mode 100755
index 0000000..0c7ad85
--- /dev/null
+++ b/lib/vid
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+source /var/onap/functions
+
+# _build_vid_images() - Function that builds VID docker images
+function _build_vid_images {
+ if [[ "$compile_repo" != "True" ]]; then
+ compile_src ${src_folders[vid]}
+ fi
+ build_docker_image ${src_folders[vid]}/deliveries
+}
+
+# get_vid_images() - Function that retrieves VID docker images
+function get_vid_images {
+ if [[ "$build_image" == "True" ]]; then
+ _build_vid_images
+ else
+ pull_openecomp_image vid
+ fi
+ pull_docker_image mariadb:10
+}
+
+# install_vid() - Download and configure Vid source code
+function install_vid {
+ vid_image=`docker images | grep vid | grep latest| awk '{print $1 ":" $2}'`
+
+ docker rm -f vid-mariadb
+ docker rm -f vid-server
+
+ run_docker_image --name vid-mariadb -e MYSQL_DATABASE=vid_openecomp -e MYSQL_USER=vidadmin -e MYSQL_PASSWORD=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U -e MYSQL_ROOT_PASSWORD=LF+tp_1WqgSY -v /opt/vid/lf_config/vid-my.cnf:/etc/mysql/my.cnf -v /opt/vid/lf_config/vid-pre-init.sql:/docker-entrypoint-initdb.d/vid-pre-init.sql -v /var/lib/mysql -d mariadb:10
+ run_docker_image -e VID_MYSQL_DBNAME=vid_openecomp -e VID_MYSQL_PASS=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U --name vid-server -p 8080:8080 --link vid-mariadb:vid-mariadb-docker-instance -d $vid_image
+}
+
+# init_vid() - Function that initialize Vid services
+function init_vid {
+ if [[ "$clone_repo" == "True" ]]; then
+ clone_repos "vid"
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_repos "vid"
+ fi
+ fi
+
+ if [[ "$skip_get_images" == "False" ]]; then
+ get_vid_images
+ if [[ "$skip_install" == "False" ]]; then
+ install_vid
+ fi
+ fi
+}