summaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/lib/vid
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2017-07-26 16:06:35 -0500
committerVictor Morales <victor.morales@intel.com>2017-07-26 16:06:35 -0500
commitdd074806ad51761392a9cca3f1f04fbbebd3de22 (patch)
tree9088768b55bf307875369e7368f56c7e66149424 /bootstrap/vagrant-onap/lib/vid
parent8805879b4dc92014381ba55b75955b295944ded6 (diff)
Sync latest changes for vagrant-onap
Given some internal procedures was not possible to submit all the changes. In the meantime, those changes were placed into an non-official project. This change syncronizes the latest changes into the official repository. Issue-id: INT-17 Change-Id: Ia4125f4b70273401e4ed3cc1908d2e2ad7d1c2e9 Signed-off-by: Victor Morales <victor.morales@intel.com>
Diffstat (limited to 'bootstrap/vagrant-onap/lib/vid')
-rwxr-xr-xbootstrap/vagrant-onap/lib/vid41
1 files changed, 35 insertions, 6 deletions
diff --git a/bootstrap/vagrant-onap/lib/vid b/bootstrap/vagrant-onap/lib/vid
index 25d2c68f6..902c45540 100755
--- a/bootstrap/vagrant-onap/lib/vid
+++ b/bootstrap/vagrant-onap/lib/vid
@@ -2,25 +2,54 @@
set -o xtrace
+source /var/onap/functions
+source /var/onap/asserts
+
+src_folder=/opt/vid
+
# pull_mariadb_image() - Pull MariaDB container image from a Docker Registry Hub
function pull_mariadb_image {
- is_package_installed docker-ce || install_docker
- docker login -u $nexus_username -p $nexus_password $nexus_docker_repo
+ docker_openecomp_login
docker pull $nexus_docker_repo/library/mariadb:10
}
+# clone_all_vid_repos() - Function that clones VID source code.
+function clone_all_vid_repos {
+ clone_repo vid $src_folder
+ clone_repo vid/asdcclient $src_folder/asdcclient
+}
+
+# compile_all_vid_repos() - Function that compiles VID source repo.
+function compile_all_vid_repos {
+ compile_src $src_folder
+ compile_src $src_folder/asdcclient
+}
+
# install_vid() - Download and configure Vid source code
function install_vid {
- local src_folder=/opt/vid
- clone_repo vid $src_folder
- pull_openecomp_image vid
+ local vid_image=openecomp/vid
+
+ clone_all_vid_repos
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_all_vid_repos
+ fi
+
+ if [[ "$build_image" == "True" ]]; then
+ compile_src $src_folder
+ build_docker_image $src_folder/deliveries
+ asserts_image $vid_image
+ vid_image=`docker images | grep vid | grep latest| awk '{print $1 ":" $2}'`
+ else
+ pull_openecomp_image vid
+ vid_image=$nexus_docker_repo/$vid_image:$docker_version
+ fi
pull_mariadb_image
docker rm -f vid-mariadb
docker rm -f vid-server
docker run --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
- docker run -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 $nexus_docker_repo/openecomp/vid:$docker_version
+ docker run -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