From dba8e02c7bcbb64c513e68cef3bb31fa87b722c0 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 23 Mar 2021 08:04:19 +0100 Subject: [PATCH] [stable-1] Install collections in CI directly with git (#2087) * Install collections in CI directly with git to work around the Galaxy CloudFlare PITA. (#2082) (cherry picked from commit 7fe9dd7a60add2e488232916479f32993b6c9970) * Repace more ansible-galaxy collection install calls. * Restrict community.kubernetes dependency. --- .../2087-restrict-kubernetes-dependency.yml | 2 ++ galaxy.yml | 2 +- tests/utils/shippable/shippable.sh | 21 +++++++++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 changelogs/fragments/2087-restrict-kubernetes-dependency.yml diff --git a/changelogs/fragments/2087-restrict-kubernetes-dependency.yml b/changelogs/fragments/2087-restrict-kubernetes-dependency.yml new file mode 100644 index 0000000000..19e213c5d0 --- /dev/null +++ b/changelogs/fragments/2087-restrict-kubernetes-dependency.yml @@ -0,0 +1,2 @@ +minor_changes: +- "Restrict dependency to community.kubernetes to < 2.0.0, since community.general will no longer work with the latest git version of community.kubernetes (https://github.com/ansible-collections/community.general/pull/2087)." diff --git a/galaxy.yml b/galaxy.yml index 2e807af178..a644de9b3f 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -10,7 +10,7 @@ tags: [community] # NOTE: No more dependencies can be added to this list dependencies: ansible.netcommon: '>=1.0.0' - community.kubernetes: '>=1.0.0' + community.kubernetes: '>=1.0.0,<2.0.0' google.cloud: '>=1.0.0' repository: https://github.com/ansible-collections/community.general documentation: https://docs.ansible.com/ansible/latest/collections/community/general/ diff --git a/tests/utils/shippable/shippable.sh b/tests/utils/shippable/shippable.sh index 5547c0c73c..ac6b1fae82 100755 --- a/tests/utils/shippable/shippable.sh +++ b/tests/utils/shippable/shippable.sh @@ -74,20 +74,29 @@ else fi # START: HACK install dependencies -retry ansible-galaxy -vvv collection install ansible.netcommon -retry ansible-galaxy -vvv collection install community.kubernetes -retry ansible-galaxy -vvv collection install google.cloud +retry git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.netcommon.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/ansible/netcommon" +retry git clone --depth=1 --single-branch https://github.com/ansible-collections/community.kubernetes.git --branch 1.2.0 "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/community/kubernetes" +retry git clone --depth=1 --single-branch https://github.com/ansible-collections/google.cloud.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/google/cloud" +# NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429) +# retry ansible-galaxy -vvv collection install ansible.netcommon +# retry ansible-galaxy -vvv collection install community.kubernetes +# retry ansible-galaxy -vvv collection install google.cloud if [ "${script}" != "sanity" ] || [ "${test}" == "sanity/extra" ]; then # Nothing further should be added to this list. # This is to prevent modules or plugins in this collection having a runtime dependency on other collections. - retry ansible-galaxy -vvv collection install community.internal_test_tools + retry git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/community/internal_test_tools" + # NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429) + # retry ansible-galaxy -vvv collection install community.internal_test_tools fi if [ "${script}" != "sanity" ] && [ "${script}" != "units" ]; then # To prevent Python dependencies on other collections only install other collections for integration tests - retry ansible-galaxy -vvv collection install ansible.posix - retry ansible-galaxy -vvv collection install community.crypto + retry git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.posix.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/ansible/posix" + retry git clone --depth=1 --single-branch https://github.com/ansible-collections/community.crypto.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/community/crypto" + # NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429) + # retry ansible-galaxy -vvv collection install ansible.posix + # retry ansible-galaxy -vvv collection install community.crypto fi # END: HACK