Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vwmaus committed Nov 6, 2020
1 parent 5f86666 commit 9be47c7
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
^CONDUCT\.md$
^CONTRIBUTING\.md$
analysis
^Dockerfile$
^\.travis\.yml$
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Build our Docker container and R pkg on Travis

env:
global:
- REPO=$DOCKER_USER/mininglucc

sudo: required

warnings_are_errors: false

language: generic

services:
- docker

before_install:
# create & run container using our dockerfile, i.e. compile pkg and render Rmd to Word doc
- docker build -t $REPO .

# push our custom docker container to docker hub, env vars stored on travis-ci.org
after_success:
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- export REPO=$DOCKER_USER/mininglucc
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
- docker build -f Dockerfile -t $REPO:$COMMIT .
- docker tag $REPO:$COMMIT $REPO:$TAG
- docker tag $REPO:$COMMIT $REPO:travis-$TRAVIS_BUILD_NUMBER
- docker push $REPO
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# get the base image, the rocker/verse has R, RStudio and pandoc
FROM rocker/geospatial:4.0.1

# required
MAINTAINER Victor Maus <[email protected]>

COPY . /mininglucc

# go into the repo directory
RUN . /etc/environment \
# Install linux depedendencies here
# e.g. need this for ggforce::geom_sina
&& sudo apt-get update \
&& sudo apt-get install libudunits2-dev -y \
# build this compendium package
&& R -e "devtools::install('/mininglucc', dep=TRUE)" \
# render the manuscript into a docx, you'll need to edit this if you've
# customised the location and name of your main Rmd file
&& R -e "rmarkdown::render('/mininglucc/analysis/paper/paper.Rmd')"

0 comments on commit 9be47c7

Please sign in to comment.