-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
78 lines (66 loc) · 1.88 KB
/
entrypoint.sh
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
usage () {
echo "Usage:
This entrypoint connects you to the executables provided by openbases
Python within the container. You could just as easily exec one of these
commands to the container, but this entrypoint makes this easy to do
with just 'run':
ob-validate: validate a paper.md for an Open Journals submission
docker run <container> validate --help
docker run <container> validate paper --help
# The repository with the paper, LICENSE, etc. is in $PWD
docker run -v $PWD:/data <container> validate --infile /data/paper.md
docker run -it -v $PWD/:/data <container> validate paper --infile /data/paper.md
ob-icons: produce
docker run <container> icons --help
docker run <container> icons
ob-paper: generate a paper.pdf for an Open Journals submission
docker run <container> paper --help
docker run <container> paper
ob-badges: generate markdown badges!
docker run <container> badges --help
docker run <container> badges
or just ask to see this global help!
docker run <container> help
"
}
if [ $# -eq 0 ]; then
usage
exit
fi
while true; do
case ${1:-} in
-h|--help|help)
usage
exit
;;
paper)
shift
exec ob-paper "$@"
exit 0
;;
validate)
shift
exec ob-validate paper "$@"
exit 0
;;
icons)
shift
exec ob-icons "$@"
exit 0
;;
badges|badge)
shift
exec ob-badge "$@"
exit 0
;;
-*)
echo "Unknown option: ${1:-}"
usage
exit 1
;;
*)
break
;;
esac
done