-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy.sh
35 lines (28 loc) · 906 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
set -o errexit -o nounset
PKG_REPO=$PWD
cd ..
addToDrat(){
mkdir drat; cd drat
## Set up Repo parameters
git init
git config user.name "Hugh Parsonage"
git config user.email "[email protected]"
git config --global push.default simple
## Get drat repo
git remote add upstream "https://[email protected]/hughparsonage/drat.git"
git fetch upstream 2>err.txt
git checkout gh-pages
Rscript -e "if (!requireNamespace('drat', quietly = TRUE)) install.packages('drat');drat::insertPackage('$PKG_REPO/$PKG_TARBALL', \
repodir = '.', \
addFiles = TRUE, \
commit='Travis update $PKG_REPO: build $TRAVIS_BUILD_NUMBER')"
git push 2>err.txt
}
addToDrat
## Other options:
## Only add if the commit is tagged: so something like:
#if [ $TRAVIS_TAG ] ; then
# addToDrat
#fi
##but will need to edit .travis.yml since $TRAVIS_BRANCH will now equal $TRAVIS_TAG