diff options
author | Markos Chandras <mchandras@suse.de> | 2018-03-10 09:59:00 +0000 |
---|---|---|
committer | Markos Chandras <mchandras@suse.de> | 2018-03-10 09:59:00 +0000 |
commit | 64521b0464b460f4056ad24719ee231cbb2079eb (patch) | |
tree | 613343b5938e6c503bcf6dc2fa26b3cff9ace95b /xci | |
parent | f06fd879a8a5f715f410456aad8d32d10a4edea0 (diff) |
xci: scripts: vm: Update package manager cache and ignore errors
We need to make sure that the local package cache is updated before we
try to install packages. Moreover, from time to time, something in the
repos may be broken so we don't want to break the CI job. As such, make
that step non-fatal as simply send the output to stdout so we can see
what's wrong.
Change-Id: I148e3b5435c604bb0d54339935255740c8ce07c0
Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'xci')
-rwxr-xr-x | xci/scripts/vm/start-new-vm.sh | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/xci/scripts/vm/start-new-vm.sh b/xci/scripts/vm/start-new-vm.sh index 868de6c3..76506830 100755 --- a/xci/scripts/vm/start-new-vm.sh +++ b/xci/scripts/vm/start-new-vm.sh @@ -119,13 +119,17 @@ COMMON_DISTRO_PKGS=(vim strace gdb htop dnsmasq docker iptables ebtables virt-ma case ${ID,,} in *suse) - pkg_mgr_cmd="sudo zypper -q -n install ${COMMON_DISTRO_PKGS[@]} qemu-kvm qemu-tools libvirt-daemon libvirt-client libvirt-daemon-driver-qemu" + pkg_mgr_cmd="sudo zypper -q -n ref" + pkg_mgr_cmd+=" && sudo zypper -q -n install ${COMMON_DISTRO_PKGS[@]} qemu-kvm qemu-tools libvirt-daemon libvirt-client libvirt-daemon-driver-qemu" ;; centos) - pkg_mgr_cmd="sudo yum install -q -y epel-release && sudo yum install -q -y in ${COMMON_DISTRO_PKGS[@]} qemu-kvm-tools qemu-img libvirt-daemon-kvm" + pkg_mgr_cmd="yum updateinfo" + pkg_mgr_cmd+=" && sudo yum install -q -y epel-release" + pkg_mgr_cmd+=" && sudo yum install -q -y in ${COMMON_DISTRO_PKGS[@]} qemu-kvm-tools qemu-img libvirt-daemon-kvm" ;; ubuntu) - pkg_mgr_cmd="sudo apt-get install -y -q=3 ${COMMON_DISTRO_PKGS[@]} libvirt-bin qemu-utils docker.io" + pkg_mgr_cmd="sudo apt-get update" + pkg_mgr_cmd+=" && sudo apt-get install -y -q=3 ${COMMON_DISTRO_PKGS[@]} libvirt-bin qemu-utils docker.io" ;; esac @@ -141,7 +145,9 @@ while true; do done echo "Installing host (${ID,,}) dependencies..." -eval ${pkg_mgr_cmd} &> /dev/null +set +e +eval ${pkg_mgr_cmd} +set -e echo "Ensuring libvirt and docker services are running..." sudo systemctl -q start libvirtd |