2020-10-08 05:35:06 +08:00
|
|
|
#!/bin/bash
|
|
|
|
# This script verifies that all shell snippets in the
|
2024-10-10 23:28:43 +08:00
|
|
|
# Linux installation tutorial work (in Ubuntu 20 container)
|
2020-10-08 05:35:06 +08:00
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
|
|
|
|
2024-10-10 23:28:43 +08:00
|
|
|
containers=(ubuntu:20.04 debian:10)
|
|
|
|
scripts=$(cd "${SCRIPT_DIR}" && ls -1 linux_*install*.sh)
|
2020-10-08 05:35:06 +08:00
|
|
|
|
2024-10-10 23:28:43 +08:00
|
|
|
docker pull debian:10
|
2020-10-08 05:35:06 +08:00
|
|
|
|
2024-10-10 23:28:43 +08:00
|
|
|
for cnt in $containers ; do
|
|
|
|
docker pull ${cnt}
|
|
|
|
for f in $scripts ; do
|
|
|
|
echo "Checking ${f} @ ${cnt}..."
|
|
|
|
docker run -it \
|
|
|
|
-e DEBIAN_FRONTEND=noninteractive \
|
|
|
|
--volume "${SCRIPT_DIR}":/install:ro \
|
|
|
|
${cnt} \
|
|
|
|
/bin/bash -ex /install/${f} --check
|
|
|
|
done
|
2020-10-08 05:35:06 +08:00
|
|
|
done
|