Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docbook-build.sh update after build scripts move
Revise the script following the move of the Python build scripts to the the main MantisBT repo.
- Loading branch information
Showing
1 changed file
with
54 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,70 @@ | ||
#!/bin/bash | ||
#----------------------------------------------------------------------------- | ||
# | ||
# MantisBT manuals build | ||
# | ||
# This script is intended to be scheduled with cron, and will build the | ||
# MantisBT manual. | ||
# | ||
#----------------------------------------------------------------------------- | ||
|
||
LOGFILE=/var/log/$(basename $0).log | ||
#------------------------------------------------------------------------------ | ||
# Parameters (edit variables as appropriate) | ||
# | ||
|
||
# references to build | ||
refs=origin/master-1.3.x,origin/master | ||
# Log file - set to /dev/null for no log | ||
LOGFILE=/var/log/$(basename "$0" .sh).log | ||
#LOGFILE=/dev/null | ||
|
||
# MantisBT repository | ||
repo=/srv/mantisbt | ||
# MantisBT repository, used to retrieve the build script (since 2.25.0) | ||
# and to checkout the reference to build | ||
# To avoid cluttering the log with unnecessary output, configure the repo | ||
# with `git config advice.detachedHead false` | ||
pathRepo=/srv/mantisbt | ||
|
||
# Target directory for manuals | ||
docs=/srv/www/docs | ||
pathDocs=/srv/www/docs | ||
|
||
# References to process | ||
# Comma-delimited list of branches, prefixed by remote (e.g. origin/master) | ||
refs=origin/master | ||
|
||
# Languages to build (blank = all) | ||
lang= | ||
|
||
|
||
#------------------------------------------------------------------------------ | ||
# Functions | ||
# | ||
|
||
function log() | ||
{ | ||
DATE=$(date +"%F %T") | ||
echo "$@" | ||
echo "$DATE $*" >>"$LOGFILE" | ||
} | ||
|
||
|
||
#------------------------------------------------------------------------------ | ||
# Main | ||
# | ||
|
||
log "Building MantisBT manuals" | ||
|
||
cd "$pathRepo" >> "$LOGFILE" || exit 1 | ||
|
||
# Update reference repository | ||
log "Updating repository in '$pathRepo'" | ||
git checkout --force master |tee -a "$LOGFILE" | ||
git pull --rebase |tee -a "$LOGFILE" | ||
|
||
# Force build | ||
if [[ "$1" = "-f" ]] || [[ "$1" = "--force" ]] | ||
then | ||
force="--force" | ||
force="--force" | ||
fi | ||
|
||
echo $(date +"%F %T") ' Building MantisBT manuals' >>$LOGFILE | ||
/srv/mantisbt-tools/docbook-manual-repo.py --all $force --ref=$refs $repo $docs $lang >>$LOGFILE 2>&1 | ||
echo $(date +"%F %T") ' Build complete' >>$LOGFILE | ||
echo "--------------------------------------------" >>$LOGFILE | ||
build/docbook-manual-repo.py --all $force --ref=$refs "$pathRepo" "$pathDocs" "$lang" 2>&1 |tee -a "$LOGFILE" | ||
|
||
log "Build complete" | ||
echo "--------------------------------------------" >>"$LOGFILE" |