-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
50 lines (41 loc) · 1.35 KB
/
justfile
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
ENTRY_CWL := "gpas_gatk4.2.4.1_mutect2_pon_workflow.cwl"
# Pack and apply Jinja templating. Creates cwl.json file
# Should be runnable in built docker container
pack:
#!/bin/sh
if [ ! -f cwl.json ]; then
just _validate_entry
just _cwltool-pack > tmp.json
just _jinja tmp.json > cwl.json
rm tmp.json
fi
just _print-cwl
# Ensures CWL entrypoint script exists
_validate_entry:
#!/bin/sh
if [ ! -f {{ENTRY_CWL}} ]; then
echo "No entry CWL file found!"
echo {{ENTRY_CWL}}
exit 1;
fi
# Prints cwl.json if exists
_print-cwl:
@cat cwl.json
# Packs CWL workflow into single json file
_cwltool-pack: _validate_entry
python3 -m cwltool --pack {{ENTRY_CWL}}
# Apply template to JSON from dockers.json, errors on missing keys
_jinja JSON:
jinja -u 'strict' -d dockers.json {{JSON}}
# Validates CWL workflow
validate: _validate_entry
python3 -m cwltool --validate {{ENTRY_CWL}}
# Formats and prints all Dockers used in workflow
get-dockers:
just pack | grep dockerPull | cut -f2- -d ":" | sort | uniq | sed "s/\"//g"
# Prints all dockerPull declarations in unformatted workflow
get-dockers-template:
just _cwltool-pack | grep dockerPull | cut -f2- -d ":" | sort | uniq | sed "s/\"//g"
# Print template input file for workflow
inputs:
python3 -m cwltool --make-template {{ENTRY_CWL}}