Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #84 from caskdata/feature/r0.2.0_fix_build
Browse files Browse the repository at this point in the history
Fix the doc build script to package docs with the redirects they need.
  • Loading branch information
John Jackson committed Oct 15, 2014
2 parents 0a252a0 + 60830ea commit 296309e
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions tigon-docs/developer-guide/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,22 @@ WEB="web"
GOOGLE_ANALYTICS_GITHUB="UA-55081520-4"
GITHUB="github"

REDIRECT_EN_HTML=`cat <<EOF
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0;url=en/index.html">
<script type="text/javascript">
window.location.href = "en/index.html"
</script>
<title></title>
</head>
<body>
</body>
</html>
EOF`
function usage() {
cd $PROJECT_PATH
PROJECT_PATH=`pwd`
Expand Down Expand Up @@ -148,7 +164,6 @@ function make_zip_html() {
function make_zip() {
# This creates a zip that unpacks to the same name
version
# ZIP_DIR_NAME="$PROJECT-docs-$PROJECT_VERSION-$1"
if [ "x$1" == "x" ]; then
ZIP_DIR_NAME="$PROJECT-docs-$PROJECT_VERSION"
else
Expand All @@ -166,14 +181,11 @@ function make_zip_localized() {
cd $SCRIPT_PATH/$BUILD
mkdir $PROJECT_VERSION
mv $HTML $PROJECT_VERSION/en
# Add a redirect index.html file
echo "$REDIRECT_EN_HTML" > $PROJECT_VERSION/index.html
zip -r $ZIP_DIR_NAME.zip $PROJECT_VERSION/*
}
function make_zip_web() {
make_zip_localized $WEB
}


function build() {
build_docs
build_javadocs
Expand All @@ -183,7 +195,7 @@ function build() {
function check_includes() {
if hash pandoc 2>/dev/null; then
echo "pandoc is installed; checking the example README includes."
echo "Confirmed that pandoc is installed; checking the example README includes."
# Build includes
BUILD_INCLUDES_DIR=$SCRIPT_PATH/$BUILD/$INCLUDES
rm -rf $BUILD_INCLUDES_DIR
Expand Down Expand Up @@ -213,7 +225,7 @@ function test_include() {
function build_includes() {
if hash pandoc 2>/dev/null; then
echo "pandoc is installed; rebuilding the example README includes."
echo "Confirmed that pandoc is installed; rebuilding the example README includes."
SOURCE_INCLUDES_DIR=$SCRIPT_PATH/$SOURCE/$EXAMPLES
rm -rf $SOURCE_INCLUDES_DIR
mkdir $SOURCE_INCLUDES_DIR
Expand All @@ -238,8 +250,6 @@ function build_quick() {
}
function build_web() {
# This is used to stage files
# desired path is 2.5.0-SNAPSHOT/en/*
build_docs_google $GOOGLE_ANALYTICS_WEB
build_javadocs
copy_javadocs
Expand All @@ -250,7 +260,7 @@ function build_github() {
build_docs_google $GOOGLE_ANALYTICS_GITHUB
build_javadocs
copy_javadocs
make_zip $GITHUB
make_zip_localized $GITHUB
}
function build_standalone() {
Expand Down Expand Up @@ -317,6 +327,5 @@ case "$1" in
version ) print_version; exit 1;;
test ) test; exit 1;;
zip ) make_zip; exit 1;;
zip-web ) make_zip_web; exit 1;;
* ) usage; exit 1;;
esac

0 comments on commit 296309e

Please sign in to comment.