Sha256: 6fd72e9c8eed35d24b86ceec99e6b52865b34b302e65ef32c2438011eb013d45

Contents?: true

Size: 1.21 KB

Versions: 17

Compression:

Stored size: 1.21 KB

Contents

#!/bin/bash

function re() {
    r "$@"
    if [ $? -ne 0 ];then
        exit $?
    fi
}

function r() {
    echo "$@"
    "$@"
}

[ "$TRAVIS_PULL_REQUEST" != "false" ] && exit 0
[ "$TRAVIS_BRANCH" != "master" -a "$TRAVIS_BRANCH" != "$(git describe --tags --always HEAD)" ] && exit 0

revision="$(git rev-parse HEAD)"
remote="$(git config remote.origin.url | sed "s+^git:+https:+")"
re ./gradlew site

r git fetch --unshallow || echo "using complete repository."

re rm -rf gh_pages
re git clone . gh_pages
re cd gh_pages

re git remote add travis_push "$remote"
re git fetch travis_push

re git checkout -b gh-pages travis_push/gh-pages
re rm -rf docs
re cp -a ../embulk-docs/build/html docs
re git add --all docs

re git config user.name "$GIT_USER_NAME"
re git config user.email "$GIT_USER_EMAIL"
r git commit -m "Updated document $revision"

git show | grep -E '^[+-] ' | grep -Eqv 'Generated by|Generated on|Search.setIndex|meta name="date" content='
if [ $? -ne 0 ];then
    echo "No document changes."
    exit 0
fi

re git config credential.helper "store --file=$HOME/.git_credentials"
echo "https://$GITHUB_TOKEN:@github.com" > "$HOME/.git_credentials"
trap "rm -rf $HOME/.git_credentials" EXIT
re git push travis_push gh-pages

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
embulk-0.6.1 embulk-docs/push-gh-pages.sh
embulk-0.6.0 embulk-docs/push-gh-pages.sh
embulk-0.5.5 embulk-docs/push-gh-pages.sh
embulk-0.5.4 embulk-docs/push-gh-pages.sh
embulk-0.5.3 embulk-docs/push-gh-pages.sh
embulk-0.5.2 embulk-docs/push-gh-pages.sh
embulk-0.5.1 embulk-docs/push-gh-pages.sh
embulk-0.5.0 embulk-docs/push-gh-pages.sh
embulk-0.4.10 embulk-docs/push-gh-pages.sh
embulk-0.4.9 embulk-docs/push-gh-pages.sh
embulk-0.4.8 embulk-docs/push-gh-pages.sh
embulk-0.4.7 embulk-docs/push-gh-pages.sh
embulk-0.4.6 embulk-docs/push-gh-pages.sh
embulk-0.4.5 embulk-docs/push-gh-pages.sh
embulk-0.4.4 embulk-docs/push-gh-pages.sh
embulk-0.4.3 embulk-docs/push-gh-pages.sh
embulk-0.4.2 embulk-docs/push-gh-pages.sh