Merge branch 'kpaulisse-git-submodule-example' into kpaulisse-release-1-10

This commit is contained in:
Kevin Paulisse 2017-05-05 13:35:56 -05:00
Родитель 18e530754d a335dfb443
Коммит 84346abbbf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 66DA91D838188671
2 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,3 @@
# git submodules
See https://github.com/github/octocatalog-diff/issues/88 for context.

Просмотреть файл

@ -0,0 +1,18 @@
#!/bin/bash
# This script is called from lib/octocatalog-diff/catalog-util/git.rb and is used to
# archive and extract a certain branch of a git repository into a target directory.
if [ -z "$OCD_GIT_EXTRACT_BRANCH" ]; then
echo "Error: Must declare OCD_GIT_EXTRACT_BRANCH"
exit 255
fi
if [ -z "$OCD_GIT_EXTRACT_TARGET" ]; then
echo "Error: Must declare OCD_GIT_EXTRACT_TARGET"
exit 255
fi
set -euf -o pipefail
git clone --single-branch -b "$OCD_GIT_EXTRACT_BRANCH" . "$OCD_GIT_EXTRACT_TARGET"
( cd "$OCD_GIT_EXTRACT_TARGET" && git submodule init && git submodule sync && git submodule update )