-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-docs
More file actions
executable file
·28 lines (22 loc) · 868 Bytes
/
build-docs
File metadata and controls
executable file
·28 lines (22 loc) · 868 Bytes
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
#!/usr/bin/env bash
source bin/.bashrc
[[ $# -ne 0 ]] && label "Usage: $0" ko && exit 1
git_clean
uri="https://github.com/msgphp/msgphp"
repo="[email protected]:msgphp/msgphp.github.io.git"
rev="$(git rev-parse --abbrev-ref --short --verify HEAD)"
docs_dir="docs" && [[ ${rev} != master ]] && docs_dir="${docs_dir}-${rev}"
label "Building"
make docs-build
[[ $? -ne 0 ]] && label "Failed" ko && exit 1
label "Synchronizing"
git_sync var/www "${repo}" && \
rm -rf "var/www/${docs_dir}" && \
mv "var/build/docs" "var/www/${docs_dir}"
[[ $? -ne 0 ]] && label "Failed" ko && exit 1
if [[ $(git -C var/www status --porcelain) ]]; then
git -C var/www add --all && \
git -C var/www commit --quiet -m "[${rev}] updated to ${uri}/commit/$(git rev-parse --short --verify HEAD)" && \
confirm "Push docs?"
[[ $? -eq 1 ]] && git -C var/www push origin master
fi