52379fa76d
This is especially important for distributions like NixOS where `/bin/bash` doesn't exist, or for MacOS users who've installed a newer version of Bash than the one that comes with their OS. Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
31 lines
987 B
Bash
Executable file
31 lines
987 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# This script is used for testing install.sh and that it works for
|
|
# each of component of our apt and yum repos
|
|
set -e
|
|
|
|
test_install_script(){
|
|
# these are equivalent to main, testing, experimental components
|
|
# in the repos, but its the url that will do the conversion
|
|
components=( experimental test get )
|
|
|
|
for component in "${components[@]}"; do
|
|
# change url to specific component for testing
|
|
local test_url=https://${component}.docker.com
|
|
local script=$(mktemp /tmp/install-XXXXXXXXXX.sh)
|
|
sed "s,url='https://get.docker.com/',url='${test_url}/'," hack/install.sh > "${script}"
|
|
|
|
chmod +x "${script}"
|
|
|
|
# test for each Dockerfile in contrib/builder
|
|
for dir in contrib/builder/*/*/; do
|
|
local from="$(awk 'toupper($1) == "FROM" { print $2; exit }' "$dir/Dockerfile")"
|
|
|
|
echo "running install.sh for ${component} with ${from}"
|
|
docker run --rm -i -v ${script}:/install.sh ${from} /install.sh
|
|
done
|
|
|
|
rm -f ${script}
|
|
done
|
|
}
|
|
|
|
test_install_script
|