<commit_before>#!/bin/sh -ex

cd $(dirname $0)/

## Use GCS until we set up Route53/CloudFront/S3

BRANCH=${TRAVIS_BRANCH:-`git rev-parse --abbrev-ref @`}
COMMIT=${TRAVIS_COMMIT:-`git rev-parse @`}
OUTPUT="weave/${BRANCH}/${COMMIT}"

if [ -n "${TRAVIS_TAG}" ]; then
  ## Travis will run separate build for commit and tag pushes,
  OUTPUT="weave/${TRAVIS_TAG}"
fi

if [ "${BRANCH}" = "latest_release_doc_updates" ]; then
  OUTPUT="weave/latest_release"
fi

export BRANCH COMMIT OUTPUT

bundle install --path=.bundle
bundle exec jekyll build --verbose

gsutil -m rsync -d _site "gs://docs.weave.works/${OUTPUT}"

echo "Published at http://docs.weave.works/${OUTPUT}"

if [ -z "${TRAVIS_TAG}" -a ! "${BRANCH}" = "latest_release_doc_updates" ]; then
  echo "<meta http-equiv=\"refresh\" content=\"0; url=http://docs.weave.works/${OUTPUT}\" />" \
    | gsutil \
      -h "Content-Type:text/html" \
      -h "Cache-Control:private, max-age=0, no-transform" \
      cp -a "public-read" - "gs://docs.weave.works/weave/${BRANCH}/index.html"
fi<commit_msg>gsutil rsync does not imply recursion<commit_after>#!/bin/sh -ex

cd $(dirname $0)/

## Use GCS until we set up Route53/CloudFront/S3

BRANCH=${TRAVIS_BRANCH:-`git rev-parse --abbrev-ref @`}
COMMIT=${TRAVIS_COMMIT:-`git rev-parse @`}
OUTPUT="weave/${BRANCH}/${COMMIT}"

if [ -n "${TRAVIS_TAG}" ]; then
  ## Travis will run separate build for commit and tag pushes,
  OUTPUT="weave/${TRAVIS_TAG}"
fi

if [ "${BRANCH}" = "latest_release_doc_updates" ]; then
  OUTPUT="weave/latest_release"
fi

export BRANCH COMMIT OUTPUT

bundle install --path=.bundle
bundle exec jekyll build --verbose

gsutil -m rsync -r -d _site "gs://docs.weave.works/${OUTPUT}"

echo "Published at http://docs.weave.works/${OUTPUT}"

if [ -z "${TRAVIS_TAG}" -a ! "${BRANCH}" = "latest_release_doc_updates" ]; then
  echo "<meta http-equiv=\"refresh\" content=\"0; url=http://docs.weave.works/${OUTPUT}\" />" \
    | gsutil \
      -h "Content-Type:text/html" \
      -h "Cache-Control:private, max-age=0, no-transform" \
      cp -a "public-read" - "gs://docs.weave.works/weave/${BRANCH}/index.html"
fi
{'fraction_non_alphanumeric': 0.1901840490797546, 'fraction_numerical': 0.005663048607833884, 'mean_word_length': 3.8401826484018264, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2852054', 'n_tokens_mistral': 811, 'n_tokens_neox': 803, 'n_words': 177}