diff --git a/.Rbuildignore b/.Rbuildignore index bd1fa45..2851bb4 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -14,3 +14,4 @@ install.R runtime.txt ^CONDUCT\.md$ +^drat\.sh$ diff --git a/.travis.yml b/.travis.yml index a583ed1..8d0aa91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,10 @@ language: r cache: packages + +r_packages: + - drat + matrix: include: - os: linux @@ -23,3 +27,4 @@ notifications: after_success: - if [[ "${R_CODECOV}" ]]; then Rscript -e 'covr::codecov(line_exclusions = list("R/zzz.R", "R/random_flows.R"))'; fi + - 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..9c00281 --- /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://$GITHUB_PAT@github.com/reconhub/recondrat.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