-
Notifications
You must be signed in to change notification settings - Fork 4
/
publish.sh
31 lines (26 loc) · 909 Bytes
/
publish.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
#!/usr/bin/env bash
HELP="Script generates documentation from current sources and pushes to remote Github repository. After executing this
script you need to manually open a Pull Request before it will be deployed. As parameter please provide name
of branch to publish to, for ex. elaborated-use-cases (note - no spaces are allowed!)"
if [ $# -eq 0 ]
then
echo $HELP
exit 0
fi
if [ $1 == "gh-pages" ]
then
echo "Please don't try to push to main branch"
exit 0
fi
BRANCH=$1
git checkout -b feature/$BRANCH
cd _src/
bin/sculpin install
bin/sculpin generate --env=prod --url=http://transeu.github.io/api-rest-documentation
cd ..
cp -rf _src/output_prod/* .
rm -rf _src/output_*
git add .
git commit -m"update documentation content"
git push origin feature/$BRANCH
echo "Now please open a Pull Request in documentation repository https://github.com/Transeu/api-rest-documentation/"