diff --git a/.travis.yml b/.travis.yml index 03c5fa2..89f1638 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,8 @@ language: r sudo: false cache: packages +r_packages: +- drat +after_success: +- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash drat.sh + diff --git a/drat.sh b/drat.sh new file mode 100644 index 0000000..f6f5352 --- /dev/null +++ b/drat.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -o errexit -o nounset +addToDrat(){ + mkdir drat; cd drat + + ## Set up Repo parameters + git init + git config --global push.default simple + + ## Get drat repo + git remote add upstream "https://$ghPat@github.com/cloudyr/cloudyr.github.io.git" + git fetch upstream + git checkout master + + Rscript -e "drat::insertPackage('../$PKG_TARBALL', repodir = './drat')" + git add --all + git commit -m "add $PKG_TARBALL (build $TRAVIS_BUILD_ID)" + git push + +} +addToDrat