-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·57 lines (46 loc) · 1.17 KB
/
deploy.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
#!/bin/bash
# Check prerequisites
if [ ! -d ".git/modules" ]; then
echo "Looks like the submodules have not been initialized."
echo "Run `git submodule init` before continuing."
exit 1;
fi
if [[ $(git status -s) ]]
then
if [ "$1" != "-f" ]; then
echo "The working directory is dirty. Please commit any pending changes."
exit 1;
else
shift
fi
fi
if [ "$#" -ne 1 ]; then
echo "Usage: $0 \"release-name\""
exit 1;
fi
if ! command -v doxygen &> /dev/null
then
echo "Error: doxygen required"
exit 1;
fi
# TODO: add logic to update the component git submodules
echo "Deleting old generated files"
rm -rf html
mkdir html
git worktree prune
rm -rf .git/worktrees/gh-pages
echo "Checking out gh-pages branch"
git worktree add -B gh-pages html origin/gh-pages
echo "Removing existing files"
rm -rf html/*
echo "Generating Files"
doxygen Doxyfile
echo "Updating gh-pages branch"
cd html && git add --all && git commit -m "$@"
cd ..
# TODO: automatically push changes
echo ""
echo ""
echo "** DONE **"
echo "Generated files are commited in 'html' directory (on 'gh-pages' branch)"
echo "DON'T FORGET TO PUSH THESE CHANGES TO 'origin'"