Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions script/updategitsubmodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ if [ -z "$GITHUB_TOKEN" ]; then
exit
fi

mkdir ~/.ssh
ssh-keyscan github.com > ~/.ssh/known_hosts
sed -i 's/git@/https:\/\//' .gitmodules || exit
sed -i 's/ssh:\/\///' .gitmodules
sed -i 's/github.com:/github.com\//' .gitmodules
sed -i "s/https:\/\/github.com/https:\/\/[email protected]/" .gitmodules
cat << credentials-file >> ~/.git-credentials
https://git:[email protected]
credentials-file

cat << config-file >> ~/.gitconfig
[credential]
helper = store
config-file

if [ "$CF_SUBMODULE_SYNC" = "true" ]; then
echo "\$CF_SUBMODULE_SYNC var is set to 'true'. Syncing submodules"
Expand All @@ -27,4 +29,4 @@ fi
echo "Updating git submodules"
echo "git submodule update --init $SUBMODULE_UPDATE_RECURSIVE_FLAG"
git submodule update --init $SUBMODULE_UPDATE_RECURSIVE_FLAG
echo "Git submodules were updated"
echo "Git submodules were updated"