forked from docker/docker-install
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes version and git commit verification
The install script won't be updated every single time a release is done so it does not make sense to tie the verification jobs to specific versions / git commits. Signed-off-by: Eli Uriegas <[email protected]>
- Loading branch information
1 parent
21098d1
commit def4691
Showing
3 changed files
with
17 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,21 @@ | ||
#!/bin/bash -e | ||
expected_version=$1 | ||
expected_gitcommit=$2 | ||
( | ||
echo "Executing installation script!" | ||
echo "INFO: Executing installation script!" | ||
sh build/install.sh | ||
) | ||
docker_version=$(docker --version) | ||
if [ $? -ne 0 ]; then | ||
|
||
# Verify that we can at least get version output | ||
if ! docker --version; 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 | ||
|
||
# Attempt to run a container if not in a container | ||
if [ ! -f /.dockerenv ]; then | ||
if ! docker run --rm hello-world; then | ||
echo "ERROR: Could not get docker to run the hello world container" | ||
exit 2 | ||
fi | ||
fi | ||
|
||
echo "INFO: Successfully verified docker installation!" |