#!/usr/bin/env bash set -euo pipefail ANSIBLE_RELEASE_FEED="$(curl -Ssl https://api.github.com/repos/ansible/ansible/tags?per_page=50)" TMPDIR="$(mktemp -d /tmp/molecule.XXXXX)" function ansible_releases { local RELEASE_LIST_ALL RELEASE_LIST_ALL="$(echo "${ANSIBLE_RELEASE_FEED}" | grep -E "\"name\": \"v[0-9]+\.[0-9]+\.[0-9]+\"")" for RELEASE in ${RELEASE_LIST_ALL} ; do echo "${RELEASE}" | grep -v "name" | sed -E 's/"v([0-9]+\.[0-9]+\.[0-9]+)",/\1/g' || true done } function build_requirements { local TEST_REQUIREMENTS local REQUIREMENTS local ANSIBLE_VERSION ANSIBLE_VERSION="${1:-true}" if [ "${ANSIBLE_VERSION}" == "true" ] ; then echo "Something went wrong!" exit 1 fi TEST_REQUIREMENTS=$( "${TMPDIR}/version_requirements.txt" make_venv "${TEST_ANSIBLE}" echo " |" | tee -a /tmp/molecule_tests.md done } main