Skip to content

Commit

Permalink
Merge pull request #44 from mrc-ide/pipeline
Browse files Browse the repository at this point in the history
Continuous Integration
  • Loading branch information
sangeetabhatia03 authored Aug 9, 2024
2 parents e5d0ab6 + 5f6fa48 commit ef407a2
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .buildkite/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM rocker/r-ver:4

RUN Rscript -e 'install.packages("pak")'

# For some reason pak fails to install urltools
RUN Rscript -e 'install.packages("urltools")'

COPY .buildkite/pkgdepends.txt /src/.buildkite/pkgdepends.txt
RUN Rscript -e 'pak::pkg_install(readLines("/src/.buildkite/pkgdepends.txt"))'

COPY . /src
27 changes: 27 additions & 0 deletions .buildkite/pipeline.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
library(orderly2)

orderly_init()
orderly_location_add(
"packit.dide",
type = "packit",
args = list(
url = "https://packit.dide.ic.ac.uk/priority-pathogens",
token = Sys.getenv("GITHUB_TOKEN"))
)

orderly_location_pull_metadata("packit.dide")
orderly_location_pull_packet("latest(name == 'db_extraction' && parameter:pathogen == 'LASSA')",
options = list(location="packit.dide"))

ids <- c(
orderly_run("db_double", parameters = list(pathogen = "LASSA")),
orderly_run("db_compilation", parameters = list(pathogen = "LASSA")),
orderly_run("lassa_serology", parameters = list(pathogen = "LASSA")),
orderly_run("lassa_severity", parameters = list(pathogen = "LASSA")),
orderly_run("lassa_delays", parameters = list(pathogen = "LASSA")),
orderly_run("lassa_transmission", parameters = list(pathogen = "LASSA")),
orderly_run("lassa_summary", parameters = list(pathogen = "LASSA")),
orderly_run("lassa_latex_tables", parameters = list(pathogen = "LASSA")),
orderly_run("lassa_collate", parameters = list(pathogen = "LASSA")))

orderly_location_push(ids, "packit.dide")
11 changes: 11 additions & 0 deletions .buildkite/pipeline.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -eux

PACKAGE_ORG=mrc-ide
PACKAGE_NAME=priority-pathogen
GIT_SHA=${BUILDKITE_COMMIT:0:7}
TAG_SHA=$PACKAGE_ORG/$PACKAGE_NAME:$GIT_SHA

docker build -t $TAG_SHA --progress=plain -f .buildkite/Dockerfile .
docker run -e GITHUB_TOKEN --rm -w /src $TAG_SHA Rscript /src/.buildkite/pipeline.R
4 changes: 4 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
steps:
- command: .buildkite/pipeline.sh
agents:
queue: "paul"
48 changes: 48 additions & 0 deletions .buildkite/pkgdepends.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
mrc-ide/orderly2
mrc-ide/orderly.sharedfile
mrc-ide/epireview
cowplot
doconv
dplyr
epitrix
estmeansd
flextable
ftExtra
ggbreak
ggforce
ggplot2
ggrepel
ggsci
ggspatial
grid
gridExtra
gt
harrypotter
ids
janitor
meta
metafor
mixdist
odbc
officer
optparse
patchwork
png
purrr
ragg
readr
readxl
rio
rnaturalearth
rnaturalearthdata
scales
sf
snakecase
splitstackshape
stringr
tibble
tidyr
tidyverse
tm
writexl
zip
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
archive
draft
.outpack

0 comments on commit ef407a2

Please sign in to comment.