blob: a9ae4f450f9bbd90333beb0046ae40e1ec812574 [file] [log] [blame]
#!/usr/bin/env bash
set -e # halt script on error
URL="https://wayang.apache.org"
BASE_URL="/"
BRANCH_PAGE=asf-site
echo "url: \"${URL}\"" > _config.yml.tmp
echo "baseurl: \"${BASE_URL}\"" >> _config.yml.tmp
cat _config.yml | grep -v "url:" >> _config.yml.tmp
mv _config.yml.tmp _config.yml
bundle exec jekyll build
bundle exec htmlproofer ./_site
mkdir -p ../tmp
mv ./_site/* ../tmp
git checkout --orphan ${BRANCH_PAGE}
rm -rf ./*
rm .asf.yaml
rm .gitignore
rm .travis*
mv ../tmp/* ./
git add -A
git status
git commit -m "Lastest site built on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to github"
git remote set-url origin https://${USER}:${TOKEN}@github.com/${TRAVIS_REPO_SLUG}
git push origin --delete ${BRANCH_PAGE}
git push origin ${BRANCH_PAGE}:${BRANCH_PAGE}