Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Sep 26, 2023
1 parent 0b1283d commit 2dd7f0d
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions tests/utils/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ error() {
exit 1
}

retry() {
local exit_code=1

for _ in 1 2 3; do
set +e
"$@"
exit_code=$?
set -e
if [ $exit_code == 0 ]; then
return $exit_code
fi
done

echo "Command '$*' failed 3 times!"
exit $exit_code
}

declare -a entry_point_args
IFS='/:' read -ra entry_point_args <<< "$1"

Expand All @@ -26,9 +43,9 @@ command -v pip
pip --version

if [ "$ansible_version" == "devel" ]; then
pip install "https://github.com/ansible/ansible/archive/devel.tar.gz"
retry pip install "https://github.com/ansible/ansible/archive/devel.tar.gz"
else
pip install "https://github.com/ansible/ansible/archive/stable-$ansible_version.tar.gz"
retry pip install "https://github.com/ansible/ansible/archive/stable-$ansible_version.tar.gz"
fi
pip list

Expand Down Expand Up @@ -58,10 +75,10 @@ else
fi

# Install dependencies
pip install rstcheck
retry pip install rstcheck

pip install -r tests/integration/requirements.txt -c tests/constraints.txt
ansible-galaxy -vvv collection install -r tests/requirements.yml
retry pip install -r tests/integration/requirements.txt -c tests/constraints.txt
retry ansible-galaxy -vvv collection install -r tests/requirements.yml

# Dump env and set timeout
timeout=45
Expand Down

0 comments on commit 2dd7f0d

Please sign in to comment.