| OLD | NEW |
| (Empty) |
| 1 #!/bin/bash | |
| 2 | |
| 3 CHANNEL=`echo $JOB | cut -f 2 -d -` | |
| 4 SHA=`git rev-parse HEAD` | |
| 5 | |
| 6 echo '===================' | |
| 7 echo '== DOCS: publish ==' | |
| 8 echo '===================' | |
| 9 echo Current channel is: $CHANNEL | |
| 10 echo Current branch is: $TRAVIS_BRANCH | |
| 11 echo Test result is: $TRAVIS_TEST_RESULT | |
| 12 | |
| 13 if [ "$CHANNEL" = "dev" ] && [ "$TRAVIS_REPO_SLUG" = "angular/angular.dart" ]; t
hen | |
| 14 if [ $TRAVIS_TEST_RESULT -eq 0 ] && [ "$TRAVIS_BRANCH" = "master" ]; then | |
| 15 echo "Gettting current docs from docs.angulardart.org repo on Github" | |
| 16 rm -Rf docs.angulardart.org | |
| 17 git clone https://github.com/angular/docs.angulardart.org.git | |
| 18 | |
| 19 echo "Removing old stable docs..." | |
| 20 rm -rf docs.angulardart.org/docs | |
| 21 | |
| 22 echo "Copying new docs into stable folder..." | |
| 23 rsync -a dartdoc-viewer/client/build/web/* docs.angulardart.org/ | |
| 24 cd docs.angulardart.org/ | |
| 25 | |
| 26 #.git folder needs to be in the *project* root | |
| 27 git config credential.helper "store --file=.git/credentials" | |
| 28 # travis encrypt GITHUB_TOKEN_ANGULAR_ORG=??? --repo=angular/angular.dart | |
| 29 echo "https://${GITHUB_TOKEN_ANGULAR_ORG}:@github.com" > .git/credentials | |
| 30 git config user.name "travis@travis-ci.org" | |
| 31 | |
| 32 echo "Adding files..." | |
| 33 git add . | |
| 34 git commit -m "Automated push of generated docs from SHA: https://github.com
/angular/angular.dart/commit/$SHA" | |
| 35 git push | |
| 36 fi | |
| 37 fi | |
| 38 | |
| 39 | |
| OLD | NEW |