Newer
Older
#!/bin/sh
# Copyright © 2021 Collabora Ltd.
# SPDX-License-Identifier: MIT
set -e
set -u
if [ -n "${TESTS_ONLY-}" ]; then
echo "1..0 # SKIP This distro is too old to run populate-depot.py"
exit 0
fi
if [ -n "${IMAGES_DOWNLOAD_URL-}" ] && [ -n "${IMAGES_DOWNLOAD_CREDENTIAL-}" ]; then
set -- \
--credential-env IMAGES_DOWNLOAD_CREDENTIAL \
--images-uri "${IMAGES_DOWNLOAD_URL}"/steamrt-SUITE/snapshots \
${NULL+}
elif [ -n "${IMAGES_SSH_HOST-}" ] && [ -n "${IMAGES_SSH_PATH-}" ]; then
set -- \
--ssh-host "${IMAGES_SSH_HOST}" \
--ssh-path "${IMAGES_SSH_PATH}" \
${NULL+}
else
# There's no public release of sniper yet, so this won't actually work
# without supplying a URL and credentials for the non-public version
echo "1..0 # SKIP no public release of sniper available"
exit 0
# When there's a public release, this will probably work
set -- \
--pressure-vessel='{"version": "latest-container-runtime-public-beta"}' \
--version latest-container-runtime-public-beta \
${NULL+}
fi
rm -fr depots/test-sniper-archives
mkdir -p depots/sniper-archives
python3 ./populate-depot.py \
--depot=depots/test-sniper-archives \
--include-archives \
--no-unpack-runtimes \
"$@" \
sniper \
${NULL+}
find depots/test-sniper-archives -ls > depots/test-sniper-archives.txt
echo "ok 1 - sniper, deploying from archive"
rm -fr depots/test-sniper-unpacked
mkdir -p depots/test-sniper-unpacked
python3 ./populate-depot.py \
--depot=depots/test-sniper-unpacked \
--no-include-archives \
--toolmanifest \
--unpack-runtimes \
--versioned-directories \
"$@" \
sniper \
${NULL+}
find depots/test-sniper-unpacked -ls > depots/test-sniper-unpacked.txt
echo "ok 2 - sniper, running from unpacked directory"
# vim:set sw=4 sts=4 et: