Skip to content

Commit

Permalink
Use packaged bats in Fedora, side-load for Ubuntu
Browse files Browse the repository at this point in the history
Fixes #139

N/B: Using these images requires an update to the podman repo. to remove
the bats installer script and `Makefile` target.

Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich committed Jun 22, 2022
1 parent 053926f commit a18a32e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
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 xzv -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
6 changes: 2 additions & 4 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

0 comments on commit a18a32e

Please sign in to comment.