forked from hms-dbmi-cellenics/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (37 loc) · 1.41 KB
/
Makefile
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
37
#!make
#----------------------------------------
# Settings
#----------------------------------------
.DEFAULT_GOAL := help
#--------------------------------------------------
# Variables
#--------------------------------------------------
# If unix name is not Darwin assume we are on Linux and add this needed env variable
# to be picked up by the R worker.
# See README.md/Running on Docker issues, for more info
ifneq ($(shell uname -s), Darwin)
# Get the gateway address of the default bridge network
export HOST_IP=$(shell docker network inspect bridge --format='{{(index .IPAM.Config 0).Gateway}}')
endif
#--------------------------------------------------
# Targets
#--------------------------------------------------
install:
@echo "Installing local runner"
@(cd ./local-runner && npm install)
@echo "Installing R env packages"
@(cd ./pipeline-runner && R -e "renv::restore()")
update-sysdata:
# regenerate sysdata.rda env file
# this step depends on your local R installation to run
@(cd ./pipeline-runner && Rscript data-raw/sysdata.R)
build:
@(cd ./local-runner && npm run build)
test:
@(cd ./pipeline-runner && R -e "devtools::test()")
run: build run-only
run-only:
@(cd ./local-runner && npm start)
.PHONY: install build run run-only help
help: ## Shows available targets
@fgrep -h "## " $(MAKEFILE_LIST) | fgrep -v fgrep | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-13s\033[0m %s\n", $$1, $$2}'