diff options
Diffstat (limited to 'bootstrap/vagrant-onap/lib/functions')
-rwxr-xr-x | bootstrap/vagrant-onap/lib/functions | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/bootstrap/vagrant-onap/lib/functions b/bootstrap/vagrant-onap/lib/functions index 435c62177..f40761f59 100755 --- a/bootstrap/vagrant-onap/lib/functions +++ b/bootstrap/vagrant-onap/lib/functions @@ -60,10 +60,6 @@ function clone_repo { else _git_timed clone ${repo_url}${repo} $dest_folder fi - else - pushd $dest_folder - _git_timed pull - popd fi } @@ -277,6 +273,16 @@ function run_docker_image { 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} @@ -287,6 +293,33 @@ function install_docker_compose { fi } +# install_chefdk() - Install ChefDK package +function install_chefdk { + local chefdk_version="2.4.17" + + if is_package_installed chefdk; then + return + fi + pushd $(mktemp -d) + source /etc/os-release || source /usr/lib/os-release + case ${ID,,} in + *suse) + ;; + ubuntu|debian) + chefdk_pkg="chefdk_$chefdk_version-1_amd64.deb" + chefdk_url="https://packages.chef.io/files/stable/chefdk/$chefdk_version/ubuntu/$VERSION_ID/$chefdk_pkg" + + wget $chefdk_url + dpkg -i $chefdk_pkg + apt-get install -f -y + ;; + rhel|centos|fedora) + rpm -Uvh "https://packages.chef.io/files/stable/chefdk/$chefdk_version/el/7/chefdk-$chefdk_version-1.el7.x86_64.rpm" + ;; + esac + popd +} + # _install_ODL() - Download and Install OpenDayLight SDN controller function _install_ODL { if [ ! -d /opt/opendaylight/current ]; then @@ -401,7 +434,7 @@ EOF 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 +447,4 @@ function add_no_proxy_value { echo "NO_PROXY=$1" >> /etc/environment fi } + |