Commit c34bc3a8 authored by Maurice A Brookhart's avatar Maurice A Brookhart
Browse files

Add .gitlab-ci.yml

parent 96cedbb9
Pipeline #2453 failed with stage
in 20 seconds
# This gitlab-ci configuration can be used in any repository that
# contains the source for an R package. It will build the package
# as an artifact of the build, and for executions on the master
# branch, it will push the package to, which
# is assumed to be mounted at /mnt/
# There is only one stage -- a packaging stage. Each job can be independently
# executed on an available runner.
- package
# Use R build docker image
# Convert the incoming branch/tag reference to a DNS compliant name
# (eg. "ABCD-1234/branch.topic" becomes "ABCD-1234-branch_topic")
- export SAFE_REF_NAME=$(echo $CI_COMMIT_REF_NAME | sed -e 's:/:-:g' -e 's:\.:_:g')
- Rscript -e "print(getOption('repos'))"
- Rscript -e "library(desc); d <-; print(d); pkgs <- subset(d, type %in% c('Imports'), select = c('package'))[,1]; print(pkgs); install.packages(pkgs);"
# Store an artifact in gitlab that is the result of R CMD build
# Keep it for a week by default. Any longer requires manual intervention
# through the UI or API.
stage: package
- rm -rf .git
- R CMD build .
expire_in: 1 week
# For master builds, push the package to
# Note: The script below does not download the dependencies of the
# package to the repository.
stage: package
- master
- rm WIHS2009*.tar.gz || true
- Rscript -e "library(miniCRAN); addLocalPackage('${CI_PROJECT_NAME}', pkgPath='..', path='/mnt/', type='source', build=TRUE)"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment