feat: Have travis bump submodule commits in docker build repository (#35216)

- [x] I have read [freeCodeCamp's contribution guidelines](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/CONTRIBUTING.md).
- [x] My pull request has a descriptive title (not a vague title like `Update index.md`)
- [x] My pull request targets the `master` branch of freeCodeCamp.

Co-authored-by: mrugesh mohapatra <1884376+raisedadead@users.noreply.github.com>
This commit is contained in:
Stuart Taylor
2019-02-15 07:44:00 +00:00
committed by mrugesh mohapatra
parent f70bf00b7e
commit 66f88f2082
2 changed files with 25 additions and 2 deletions

View File

@ -21,5 +21,12 @@ before_script:
- git config --global user.email team+camperbot@freeCodeCamp.org
- git config --global user.name "CamperBot"
script:
- npm run test
jobs:
include:
- stage: Unit and Integration tests
script: npm test
- stage: Artifacts builds
if: branch = master && type != pull_request
script: bash trigger-build.sh

16
trigger-build.sh Normal file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
pushd "$TRAVIS_BUILD_DIR"
if [ -n "$DOCKER_PUSH_API_TOKEN" ]
then
git clone https://github.com/"$DOCKER_PUSH_REPO".git docker-push-repo
cd docker-push-repo/freecodecamp
git pull --rebase origin master
cd ../
git add freecodecamp
git -c user.name="$DOCKER_PUSH_USER" -c user.email='travis' \
commit -m 'chore(ci): Travis CI - bump submodule'
git push https://"$DOCKER_PUSH_USER":"$DOCKER_PUSH_API_TOKEN"@github.com/"$DOCKER_PUSH_REPO".git master
fi
popd