Merge "[generate_puppetfile] Add support for handling commit"

This commit is contained in:
Zuul 2018-08-01 05:34:42 +00:00 committed by Gerrit Code Review
commit 18b6cf0a6d

View File

@ -33,11 +33,15 @@ for e in $(cat external_modules.txt); do
if [ ! -z "$pin" ]; then
git ls-remote --exit-code https://github.com/$namespace/$module $pin
if (($? == 2)); then
if ! git ls-remote --exit-code https://github.com/$namespace/$module | grep -q $pin; then
echo "Wrong pin: $pin does not exist in $module module."
exit 1
else
tag=$pin
fi
else
tag=$pin
fi
else
git clone https://github.com/$namespace/$module modules/$module
tag=$(cd modules/$module; git describe --tags $(git rev-list --tags --max-count=1))