Debian Codegraph @

ansible_collections/community/general/tests/utils/list-remotes

raw
1 #!/bin/sh
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 SUPPORTED_AC2="17 18 19 20"
7
8 [ -z "$1" ] && {
9 echo 'usage: ./tests/utils/list-remotes <ansible git repo dir>' >&2
10 exit 1
11 }
12 ansible_repo_dir="$1"
13
14 (
15 cd "$ansible_repo_dir"
16
17 versions=$(
18 for minor in $SUPPORTED_AC2; do
19 echo v2.$minor.$(git tag -l | awk -F. "\$2 == $minor && /v2\.[0-9]+\.[0-9]+$/ { print \$3 }" | sort -rn | head -1)
20 done
21 )
22 versions="$versions devel"
23
24 echo "Listing remotes from ansible-core:" $versions >&2
25 for head in $versions; do
26 git checkout -q $head
27 cat test/lib/ansible_test/_data/completion/remote.txt
28 done | awk '/[a-z]+(\/[0-9]+)?/ { print $1 }' | sort -u | sed -e s'/\///g'
29 )