Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use packaged bats in Fedora, side-load for Ubuntu #140

Merged
merged 2 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cache_images/fedora_packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ INSTALL_PACKAGES=(\
autoconf
automake
bash-completion
bats
bridge-utils
btrfs-progs-devel
buildah
Expand Down
16 changes: 15 additions & 1 deletion cache_images/podman_tooling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,28 @@
# as root or through sudo. The script should not be used for any other
# purpose or from any other context.

set -e
set -eo pipefail

SCRIPT_FILEPATH=$(realpath "${BASH_SOURCE[0]}")
SCRIPT_DIRPATH=$(dirname "$SCRIPT_FILEPATH")
REPO_DIRPATH=$(realpath "$SCRIPT_DIRPATH/../")
# shellcheck source=./lib.sh
source "$REPO_DIRPATH/lib.sh"

if [[ "$OS_RELEASE_ID" == "ubuntu" ]]; then
if [[ -n "$(type -P bats)" ]]; then
die "Bats _MUST_ not be installed on ubuntu until fixed: https://bugs.launchpad.net/ubuntu/+source/bats/+bug/1882542"
fi
bats_version="1.7.0"
dl_url="https://github.com/bats-core/bats-core/archive/v${bats_version}.tar.gz"
echo "Installing bats $bats_version"
curl --fail --location "$dl_url" | tar xz -C /tmp
pushd /tmp/bats-core-$bats_version
$SUDO ./install.sh /usr/local # prints install location
popd
rm -rf /tmp/bats-core-$bats_version
fi

echo "Configuring Go environment"
export GOPATH="${GOPATH:-/var/tmp/go}"
mkdir -p "$GOPATH"
Expand Down
8 changes: 3 additions & 5 deletions cache_images/ubuntu_packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ bigto ooe.sh $SUDO apt-get -qq -y upgrade

echo "Configuring additional package repositories"


# Useful version of criu is only available from launchpad repo
if [[ "$OS_RELEASE_VER" -le 2004 ]]; then
lilto ooe.sh $SUDO add-apt-repository --yes ppa:criu/ppa
Expand All @@ -44,9 +43,8 @@ curl --fail --silent --location --url "$GPG_URL" | \
$SUDO tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_unstable_ci.gpg &> /dev/null


# Removed golang-1.14 from install packages due to known
# performance reason. Reinstall when ubuntu has 1.16.

# N/B: DO NOT install the bats package on Ubuntu VMs, it's broken.
# ref: (still open) https://bugs.launchpad.net/ubuntu/+source/bats/+bug/1882542
INSTALL_PACKAGES=(\
apache2-utils
apparmor
Expand Down Expand Up @@ -145,7 +143,7 @@ INSTALL_PACKAGES=(\
# Necessary to update cache of newly added repos
lilto $SUDO apt-get -q -y update

if (($OS_RELEASE_VER>=2104)); then
if (($OS_RELEASE_VER==2104)); then
echo "Blocking golang-* package interfearance with kubik containers-common"
$SUDO apt-mark hold golang-github-containers-common golang-github-containers-image
fi
Expand Down