-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.sh
36 lines (29 loc) · 931 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
36
#!/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 "Richard White"
git config user.email "r@rwhite.no"
git config --global push.default simple
## Get drat repo
git remote add upstream "https://$GH_TOKEN@github.com/folkehelseinstituttet/drat.git"
git fetch upstream 2>err.txt
git checkout gh-pages
Rscript -e "drat::insertPackage('$PKG_REPO/$PKG_TARBALL', \
repodir = '.', \
commit='Travis update $PKG_REPO: build $TRAVIS_BUILD_NUMBER')"
Rscript -e "saveRDS(read.dcf('src/contrib/PACKAGES'),'src/contrib/PACKAGES.rds')"
git commit -a -m "Fixing PACKAGES.rds"
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