mirror of
https://github.com/docker/docker-install.git
synced 2026-11-20 10:03:11 +03:00
By executing `bash verify-docker-install`, the `bash -e` at the top of the script is not honored. Should just execute the script straight-up to use whatever `set` options are desired in the script. Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
30 lines
783 B
Bash
Executable File
30 lines
783 B
Bash
Executable File
#!/bin/bash -e
|
|
expected_version=$1
|
|
expected_gitcommit=$2
|
|
(
|
|
echo "Executing installation script!"
|
|
sh build/install.sh
|
|
)
|
|
docker_version=$(docker --version)
|
|
if [ $? -ne 0 ]; then
|
|
echo "ERROR: Did Docker get installed?"
|
|
exit 3
|
|
fi
|
|
installed_version=$(echo $docker_version | awk '{print$3}')
|
|
installed_gitcommit=$(echo $docker_version | awk '{print$5}')
|
|
echo $docker_version
|
|
echo -n "Checking if installed version '$installed_version' matches '$expected_version'... "
|
|
if [[ "$installed_version" =~ "$expected_version" ]]; then
|
|
echo "PASSED!"
|
|
else
|
|
echo "FAILED!"
|
|
exit 1
|
|
fi
|
|
echo -n "Checking if installed gitcommit '$installed_gitcommit' matches '$expected_gitcommit'... "
|
|
if [[ "$installed_gitcommit" =~ "$expected_gitcommit" ]]; then
|
|
echo "PASSED!"
|
|
else
|
|
echo "FAILED!"
|
|
exit 2
|
|
fi
|