Refactor install_docker_compose function
Usually this function is followed by a run command, this change
ensure that docker-compose program is installed before its execution
Change-Id: Ic68616a1db1e3c5bee516985c74f369a956d6775
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-ID: INT-436
diff --git a/bootstrap/vagrant-onap/lib/functions b/bootstrap/vagrant-onap/lib/functions
index 435c621..79a80c6 100755
--- a/bootstrap/vagrant-onap/lib/functions
+++ b/bootstrap/vagrant-onap/lib/functions
@@ -60,10 +60,6 @@
else
_git_timed clone ${repo_url}${repo} $dest_folder
fi
- else
- pushd $dest_folder
- _git_timed pull
- popd
fi
}
@@ -277,6 +273,16 @@
docker run $@
}
+# run_docker_compose() - Ensures that docker compose is installed and run it in background
+function run_docker_compose {
+ local folder=$1
+
+ install_docker_compose
+ pushd $folder
+ /opt/docker/docker-compose up -d
+ popd
+}
+
# install_docker_compose() - Download and install docker-engine
function install_docker_compose {
local docker_compose_version=${1:-1.12.0}
@@ -401,7 +407,7 @@
echo "${dev_name}1 $mount_dir ext4 errors=remount-ro,noatime,barrier=0 0 1" >> /etc/fstab
}
-# add no_proxy values to environment, used for internal IPs generated at deploy time
+# add_no_proxy_value() - Add no_proxy values into environment file, used for internal IPs generated at deploy time
function add_no_proxy_value {
if [[ `grep "no_proxy" /etc/environment` ]]; then
sed -i.bak "s/^no_proxy.*$/&,$1/" /etc/environment
@@ -414,3 +420,4 @@
echo "NO_PROXY=$1" >> /etc/environment
fi
}
+