Sha256: 9d12b2d5a665a759f6530877654f41057a2add8014bcad2dbf1f7e8f3a369021

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 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" ] && 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

1 entries across 1 versions & 1 rubygems

Version Path
embulk-0.4.1 embulk-docs/push-gh-pages.sh