Created
March 10, 2020 08:09
-
-
Save fvosberg/958d7be3254148a1b45e63c351e8d404 to your computer and use it in GitHub Desktop.
.gitlab-ci GIT submodule check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variables: | |
GIT_SUBMODULE_STRATEGY: recursive | |
check_submodule_updates: | |
stage: test | |
# a warning is sufficient for this check, it should not prevent a deployment | |
allow_failure: true | |
script: | |
- cd path-to-submodule | |
- git fetch origin | |
- | | |
if [ "$(git log origin/master ^HEAD)" != "" ]; then | |
echo -e "\nNew git commits for submodule\n\nPlease update with\n\ncd path-to-submodule\ngit pull origin master\ncd ../../\ngit commit -am '[TASK] update submodule'\n\nMissing commits:\n" | |
git log origin/master ^HEAD | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment