diff --git a/.travis.yml b/.travis.yml index 2123864bd2..ccf3bf4e9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 + diff --git a/trigger-build.sh b/trigger-build.sh new file mode 100644 index 0000000000..fcafd16e39 --- /dev/null +++ b/trigger-build.sh @@ -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