-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·50 lines (39 loc) · 852 Bytes
/
build.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
#!/bin/bash
#
# Script that builds the CV to PDF documents.
# Will also deploy to github if flag -d or --deploy is given.
# Currently supported languages: English, Finnish.
# Stop execution on error.
set -e
BUILD=true
DEPLOY=false
# Check for flags.
while test $# -gt 0; do
case "$1" in
-nb|--no-build)
BUILD=false
shift
;;
-d|--deploy)
DEPLOY=true
shift
;;
*)
break
;;
esac
done
if [ "$BUILD" = true ] ; then
docker build . -t cv
docker run --rm -i --net=none -v "$PWD"/doc:/doc -t cv ./scripts/build.sh
fi
if [ "$DEPLOY" = true ] ; then
pushd ../ikudjoi
git fetch origin
git reset --hard origin/master
cp ../cv/doc/dist/CV_Ilkka_Kudjoi_*.pdf .
git add CV_Ilkka_Kudjoi_*.pdf
git commit -m "Updated CV's from https://github.com/ikudjoi/cv"
git push
popd
fi