Vicky Steeves
@VickySteeves | @VickySteeves@Octodon.Social
csv,conf,v4 | May 9, 2019
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
GitLab is a git-based hosting service (they store your git repos!)
They have an open-core model: the community edition is FLOSS, the enterprise edition is not (like RStudio)
It's really different from other similar services for many reasons which you can find on their site (about.gitlab.com/comparison/) but I want to go over a few key reasons that make it ideal for building (a subset of) work reproducibly!
GitLab has integrated CI in each repo -- in fact, hosting, LFS, and CI is free for public & private repos!!
You can use their Docker Container Registry, a secure, private Docker registry with GitLab CI to run each job in a separate & isolated container using the predefined image that is set up in .gitlab-ci.yml
. If you don’t feel like using the GitLab registry, you can also use images from DockerHub or a custom Docker container you’re already using locally.
This makes it easier to have a simple and reproducible build environment that can also run on your local workstation, regardless of it's operating system!
It also means that as soon as someone else forks your repo, the CI will automatically run and give them results without having to go to a 3rd party tool (e.g. Travis, Circle).
FYI, GitLab knows to syntax-check .gitlab-ci.yml!
article:
stage: deploy
image: rocker/verse:3.4.4
script:
- Rscript -e "remove.packages('rticles')" -e "devtools::install_github('nuest/rticles', ref = 'copernicus')"
- Rscript -e "rmarkdown::render('MyArticle/MyArticle.Rmd')"
artifacts:
paths:
- MyArticle
when: always
The file configures a build job named article
and a list of script steps executed within a specific Docker image as part of the deploy stage. In this case we use a versioned image of rocker/geospatial
because we want to do geospatial analyses in our article and the image has the important libraries already installed.
The directory of the article is configured as the job’s artifacts, which in this example is a computational article for a journal.
If your collaborators are on another platform, or you want to simply be more discoverable, you can sync between remotes automatically, either pushing or pulling!
I use this to auto-sync repos between GitLab (where I work) and GitHub (where people tend to discover my work)
Tweet me: @VickySteeves
Toot me: @VickySteeves@Octodon.Social
Get this Presentation:
vickysteeves.gitlab.io/csvconf4-lightningtalk