THIS IS ONLY A TEST INSTANCE. DON'T DO IMPORTANT WORK HERE!

Unverified Commit e36d7d32 authored by Flavius Lacatusu's avatar Flavius Lacatusu
Browse files

Create new script to install dependencies like KVM driver for minishift


Signed-off-by: default avatarFlavius Lacatusu <flacatus@redhat.com>
parent 204b24b2
#!/bin/bash
#
# Copyright (c) 2012-2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
set -e
installStartDocker() {
if [ -x "$(command -v docker)" ]; then
echo "[INFO] Docker already installed"
else
echo "[INFO] Installing docker..."
yum install --assumeyes -d1 yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install --assumeyes -d1 docker-ce
systemctl start docker
docker version
fi
}
install_required_packages() {
# Install EPEL repo
yum -y install epel-release
# Get all the deps in
yum -y install libvirt qemu-kvm
echo '[INFO]CICO: Required virtualization packages installed'
}
start_libvirt() {
systemctl start libvirtd
}
setup_kvm_machine_driver() {
echo "[INFO] Installing docker machine kvm drivers..."
curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.10.0/docker-machine-driver-kvm-centos7 -o /usr/bin/docker-machine-driver-kvm
chmod +x /usr/bin/docker-machine-driver-kvm
check_libvirtd=$(systemctl is-active libvirtd)
if [ $check_libvirtd != 'active' ]; then
virsh net-start default
fi
}
......@@ -15,6 +15,7 @@ set -e -x
trap 'Catch_Finish $?' EXIT SIGINT
# Catch errors and force to delete minishift VM.
cleanup() {
echo "[INFO] Deleting minishift VM..."
yes | ./tmp/minishift delete && rm -rf ~/.minishift ${OPERATOR_REPO}/tmp
......@@ -31,21 +32,7 @@ Catch_Finish() {
fi
}
installStartDocker() {
if [ -x "$(command -v docker)" ]; then
echo "[INFO] Docker already installed"
else
echo "[INFO] Installing docker..."
yum install --assumeyes -d1 yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install --assumeyes -d1 docker-ce
systemctl start docker
docker version
fi
}
init() {
installStartDocker
MSFT_RELEASE="1.34.2"
GO_TOOLSET_VERSION="1.11.5-3"
IP_ADDRESS="172.17.0.1"
......@@ -101,9 +88,14 @@ run_tests() {
echo "[INFO] Run tests..."
./tmp/run-tests
echo "[INFO] Tests passed successfully!"
}
init
source ./cico_common.sh
installStartDocker
install_required_packages
start_libvirt
setup_kvm_machine_driver
run_tests
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment