Skip to content

Commit

Permalink
Merge pull request #140 from cevich/fix_bats_environments
Browse files Browse the repository at this point in the history
Use packaged bats in Fedora, side-load for Ubuntu
  • Loading branch information
cevich authored Jun 30, 2022
2 parents ab788de + 98b5d75 commit e856225
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 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 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

0 comments on commit e856225

Please sign in to comment.