Sha256: 92fa778a430d1265b4810ff7fbb9c573f0f2d95ad0156aaf9c52c8189c8e5b10

Contents?: true

Size: 1.45 KB

Versions: 5

Compression:

Stored size: 1.45 KB

Contents

#!/bin/bash
#
# this hook runs the publish_html.sh script which, in turn,
# publishes html versions of adoc files to the desired
# destination.
#
#
# Adjust the WORKING_TREE_ROOT, DST_DIR and SRC_DIR below to
# locations suitable for your setup

### config section
# set this to the repo root where the working tree exists
WORKING_TREE_ROOT="/the/path/to/the/stage/repo"

# set this to the publish root dir served by a web server
DST_DIR="/the/path/to/webserver/directory/root"

# set this to "true" if you want to force an 'rm -rf'of
# the destination dir before generating new htmls
CLEAR_DST=""

# set this to the top dir to look for docs under in the
# staging repo. This shall be given as a relative path
# from the top dir of the git repo.
SRC_DIR="."

# Make config available in subshell
export WORKING_TREE_ROOT
export DST_DIR
export SRC_DIR
export CLEAR_DST

# read the input from git...not currently used.
# it could for example be used to filter on git branches
#
# while read line
# do
#   echo "git ref: $line"
# done < /dev/stdin

echo "Post update hook running..."
(
  cd "${WORKING_TREE_ROOT}"

  # need to unset the GIT_DIR env set by the invoking hook...
  unset GIT_DIR

  # Run the publish script
  PUBLISH_SCRIPT="scripts/publish_html.sh"
  echo "invoking publish script at ${WORKING_TREE_ROOT}/${PUBLISH_SCRIPT}"
  if [[ -z "${CLEAR_DST}" ]]; then
    "${PUBLISH_SCRIPT}" "${DST_DIR}" "${SRC_DIR}"
  else
    "${PUBLISH_SCRIPT}" -f "${DST_DIR}" "${SRC_DIR}"
  fi

)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
giblish-0.8.2 scripts/hooks/post-receive
giblish-0.8.1 scripts/hooks/post-receive
giblish-0.8.0 scripts/hooks/post-receive
giblish-0.7.6 scripts/hooks/post-receive
giblish-0.7.5 scripts/hooks/post-receive