Skip to content

Commit

Permalink
build: Install guest-component deps
Browse files Browse the repository at this point in the history
clang & devmapper libs

Fixes: kata-containers#5750

Signed-off-by: Suraj Deshmukh <[email protected]>
  • Loading branch information
surajssd committed Aug 22, 2023
1 parent 6ab2a91 commit c26fd38
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .ci/install_guest_component_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
#
# Copyright Confidential Containers Contributors
#
# SPDX-License-Identifier: Apache-2.0
#

set -o errexit
set -o nounset
set -o pipefail

# Detect if the OS is Ubuntu or fedora
source "/etc/os-release" || source "/usr/lib/os-release"

# On Ubuntu or debian, install the dependencies
if [ "$ID" == "ubuntu" ] || [ "$ID" == "debian" ]; then
export DEBIAN_FRONTEND=noninteractive
sudo apt update
sudo apt install -y \
libdevmapper-dev \
clang

exit 0
fi

# On Fedora, install the dependencies
if [ "$ID" == "fedora" ]; then
sudo dnf install -y \
device-mapper-devel \
clang

exit 0
fi

# On CentOS 8 Stream
if [ "$ID" == "centos" ] && [ "$VERSION_ID" == "8" ]; then
# Enable powertools repo to be able to install the developer library for device-mapper
sudo yum install -y \
dnf-plugins-core
sudo yum config-manager --set-enabled powertools

sudo yum install -y \
device-mapper-devel \
clang
exit 0
fi

echo "Unsupported OS: $PRETTY_NAME"
exit 1
5 changes: 4 additions & 1 deletion .ci/jenkins_job_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ fi
# - We got get changes if versions.yaml changed.
"${GOPATH}/src/${tests_repo}/.ci/install_go.sh" -p -f

# Install the guest component dependencies.
"${GOPATH}/src/${tests_repo}/.ci/install_guest_component_dependencies.sh"

# Check if we can fastpath return/skip the CI
# Work around the 'set -e' dying if the check fails by using a bash
# '{ group command }' to encapsulate.
Expand Down Expand Up @@ -307,4 +310,4 @@ case ${test_type} in
*) echo "Unknown test type." >&2 && exit 1 ;;
esac

popd
popd

0 comments on commit c26fd38

Please sign in to comment.