mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-21 19:33:04 +00:00
skip_changelog(ci): pin docker collection on old ansible versions
Signed-off-by: gardar <gardar@users.noreply.github.com>
This commit is contained in:
parent
81d3d62775
commit
b81a5ff13b
1 changed files with 13 additions and 7 deletions
|
@ -27,18 +27,24 @@ if [ "$(printf '%s\n' "2.12" "$ansible_version" | sort -V | head -n1)" = "2.12"
|
|||
ansible-galaxy collection install -r "$collection_root/requirements.yml"
|
||||
elif [ "$(printf '%s\n' "2.10" "$ansible_version" | sort -V | head -n1)" = "2.10" ]; then
|
||||
python -m pip install molecule molecule-docker
|
||||
ansible-galaxy collection install git+https://github.com/ansible-collections/community.docker.git
|
||||
ansible-galaxy collection install git+https://github.com/ansible-collections/community.docker.git,stable-3
|
||||
ansible-galaxy collection install -r "$collection_root/requirements.yml"
|
||||
else
|
||||
python -m pip install molecule molecule-docker
|
||||
req_dir=$(mktemp -d)
|
||||
requirements="$(awk '/name:/ {print $3}' < "$collection_root/requirements.yml") https://github.com/ansible-collections/community.docker.git"
|
||||
requirements="$(awk '/name:/ {print $3}' < "$collection_root/requirements.yml") https://github.com/ansible-collections/community.docker.git,stable-3"
|
||||
for req in $requirements; do
|
||||
git -C "$req_dir" clone --single-branch --depth 1 "$req"
|
||||
req="${req##*/}"
|
||||
req="${req%.*}"
|
||||
ansible-galaxy collection build "$req_dir/$req" --output-path "$req_dir"
|
||||
ansible-galaxy collection install "$req_dir/${req//./-}"-*.tar.gz
|
||||
if [[ "$req" == *","* ]]; then
|
||||
branch="${req##*,}"
|
||||
req="${req%,*}"
|
||||
git -C "$req_dir" clone --branch "$branch" --single-branch --depth 1 "$req"
|
||||
else
|
||||
git -C "$req_dir" clone --single-branch --depth 1 "$req"
|
||||
fi
|
||||
req="${req##*/}"
|
||||
req="${req%.*}"
|
||||
ansible-galaxy collection build "$req_dir/$req" --output-path "$req_dir"
|
||||
ansible-galaxy collection install "$req_dir/${req//./-}"-*.tar.gz
|
||||
done
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue