-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (52 loc) · 1.87 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
SHELL := /bin/bash
ALL_CONFIGS := $(subst .config.toml,,$(wildcard *.config.toml))
msg ?= init
runner ?= apptainer
help:
@echo "Usage: make [target] [runner=apptainer|local] [msg=commit message]"
@echo "Targets:"
@echo " help: Show this help message"
@echo " all: Run all configurations (without .config.toml)"
@echo " runner=apptainer|local: Run with apptainer or locally"
@echo " data: Prepare data"
@echo " list-configs: List all configurations"
@echo " <config>: Run a specific configuration (without .config.toml)"
@echo " runner=apptainer|local: Run with apptainer or locally"
@echo " commit: Commit changes without history"
@echo " msg=commit message: Commit message"
@echo " push: Commit and push changes to remote without history"
@echo " msg=commit message: Commit message"
@echo " submit: Alias for push"
@echo " msg=commit message: Commit message"
all: $(ALL_CONFIGS)
data:
bash prepare-data.sh
list-configs:
@echo $(ALL_CONFIGS) | tr ' ' '\n'
%: %.config.toml
@if [ "$(runner)" = "local" ]; then \
echo immunopipe @$< \
--name $(shell basename $< .config.toml)Local \
--outdir $(shell grep -oP 'outdir = "\K[^"]+' $<)-local; \
immunopipe @$< \
--name $(shell basename $< .config.toml)Local \
--outdir $(shell grep -oP 'outdir = "\K[^"]+' $<)-local; \
else \
echo apptainer run --pwd /workdir -B .:/workdir,/tmp -c -e --unsquash --writable-tmpfs \
docker://justold/immunopipe:dev-full \
@$<; \
apptainer run --pwd /workdir -B .:/workdir,/tmp -c -e --unsquash --writable-tmpfs \
docker://justold/immunopipe:dev-full \
@$<; \
fi
commit:
@rm -rf .git/; \
git init; \
git add .; \
git commit -m "$(msg)"; \
git remote add origin https://github.com/pwwang/immunopipe-example.git;
push:
make commit msg="$(msg)"; \
git push -u --force origin master
submit: push
.PHONY: all data commit push submit list-configs