stages:
- update
update_submodules:
stage: update
only:
- triggers
tags:
- docker
- ci
image: docker:git
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- git config --global user.name "gitlab bot"
- git config --global user.email "gitlab-bot@tiho-mobi.com"
- git remote set-url origin https://gitlab-ci-token:${GIT_PUSH_TOKEN}@gitlab.test.com/test.git
script:
- |
git submodule update --remote --merge
git add .
if git diff-index --quiet HEAD; then
echo "Nothing changed"
else
git commit -m "Auto update submodules"
git push origin HEAD:master
fi