doc: gitignore; ./build-website.bash --no-commit
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -4,4 +4,6 @@
|
|||||||
.*
|
.*
|
||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
|
doc/changelog.rst
|
||||||
venv*
|
venv*
|
||||||
|
website-build/
|
||||||
|
@@ -3,12 +3,21 @@ set -e
|
|||||||
|
|
||||||
build="$PWD/website-build"
|
build="$PWD/website-build"
|
||||||
usage="Builds eventlet.net website static pages into ${build}.
|
usage="Builds eventlet.net website static pages into ${build}.
|
||||||
Requires sphinx-build, git and Github account."
|
Requires sphinx-build, git and Github account.
|
||||||
|
|
||||||
|
--no-commit Just build HTML, skip any git operations."
|
||||||
|
|
||||||
|
commit=1
|
||||||
while [ -n "$1" ]; do
|
while [ -n "$1" ]; do
|
||||||
# TODO: parse args
|
case $1 in
|
||||||
echo "$usage" >&2
|
--no-commit)
|
||||||
exit 1
|
commit=0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "$usage" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -18,7 +27,7 @@ if ! which sphinx-build >/dev/null; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! git status >/dev/null; then
|
if [ $commit -eq 1 ] && ! git status >/dev/null; then
|
||||||
echo "git not found. git and Github account are required to update online documentation." >&2
|
echo "git not found. git and Github account are required to update online documentation." >&2
|
||||||
echo "Links: http://git-scm.com/ https://github.com/" >&2
|
echo "Links: http://git-scm.com/ https://github.com/" >&2
|
||||||
exit 1
|
exit 1
|
||||||
@@ -40,23 +49,26 @@ cp NEWS doc/changelog.rst
|
|||||||
sphinx-build -b html -d "$build/tmp" -n -q "doc" "$build/doc"
|
sphinx-build -b html -d "$build/tmp" -n -q "doc" "$build/doc"
|
||||||
rm -rf "$build/tmp"
|
rm -rf "$build/tmp"
|
||||||
rm -f "$build/doc/.buildinfo"
|
rm -f "$build/doc/.buildinfo"
|
||||||
|
rm -f "doc/changelog.rst"
|
||||||
|
|
||||||
echo "3. Updating git branch gh-pages"
|
if [ $commit -eq 1 ]; then
|
||||||
source_name=`git rev-parse --abbrev-ref HEAD`
|
echo "3. Updating git branch gh-pages"
|
||||||
source_id=`git rev-parse --short HEAD`
|
source_name=`git rev-parse --abbrev-ref HEAD`
|
||||||
git branch --track gh-pages origin/gh-pages || true
|
source_id=`git rev-parse --short HEAD`
|
||||||
git checkout gh-pages
|
git branch --track gh-pages origin/gh-pages || true
|
||||||
git ls-files -z |xargs -0 rm -f
|
git checkout gh-pages
|
||||||
rm -rf "doc"
|
git ls-files -z |xargs -0 rm -f
|
||||||
|
rm -rf "doc"
|
||||||
|
|
||||||
mv "$build"/* ./
|
mv "$build"/* ./
|
||||||
touch ".nojekyll"
|
touch ".nojekyll"
|
||||||
echo "eventlet.net" >"CNAME"
|
echo "eventlet.net" >"CNAME"
|
||||||
rmdir "$build"
|
rmdir "$build"
|
||||||
|
|
||||||
echo "4. Commit"
|
echo "4. Commit"
|
||||||
git add -A
|
git add -A
|
||||||
git status
|
git status
|
||||||
|
|
||||||
read -p "Carefully read git status output above, press Enter to continue or Ctrl+C to abort"
|
read -p "Carefully read git status output above, press Enter to continue or Ctrl+C to abort"
|
||||||
git commit --edit -m "Website built from $source_name $source_id"
|
git commit --edit -m "Website built from $source_name $source_id"
|
||||||
|
fi
|
||||||
|
Reference in New Issue
Block a user