Skip to content

Travis fixes for HonKit, take 2 #729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ node_js:
- "12"

before_script:
- BOOK_BUILD_DIR="${TRAVIS_BUILD_DIR}"/_book
- export BOOK_BUILD_DIR="${TRAVIS_BUILD_DIR}"/_book
- env | sort

script:
- npm run build
# Make sure the book built.
- |
book_check_file="${BOOK_BUILD_DIR}/index.html"
if [[ ! -f "${book_check_file}" ]]; then
echo "${book_check_file} not found"
exit 1
fi

after_success:
- |
Expand Down
25 changes: 15 additions & 10 deletions tools/deploy/update_site_travis.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ set -o errexit
bold=$(tput bold)
normal=$(tput sgr0)

if [ -z ${DOCS_BRANCH_NAME+x} ]; then
if [[ -z ${DOCS_BRANCH_NAME+x} ]]; then
echo "${bold}\$DOCS_BRANCH_NAME is not set!${normal}"
exit 1
elif [ -z ${DOCS_REPO_NAME+x} ]; then
elif [[ -z ${DOCS_REPO_NAME+x} ]]; then
echo "${bold}\$DOCS_REPO_NAME is not set!${normal}"
exit 1
elif [ -z ${DOCS_REPO_OWNER+x} ]; then
elif [[ -z ${DOCS_REPO_OWNER+x} ]]; then
echo "${bold}\$DOCS_REPO_OWNER is not set!${normal}"
exit 1
elif [ -z ${GH_TOKEN+x} ]; then
elif [[ -z ${GH_TOKEN+x} ]]; then
echo "${bold}\$GH_TOKEN is not set!${normal}"
exit 1
fi
Expand All @@ -34,8 +34,18 @@ git config user.email "travis@travis-ci.org"
GH_REPO_REF="github.com/${DOCS_REPO_OWNER}/${DOCS_REPO_NAME}.git"

# Assume the book has already been built and lives in $BOOK_BUILD_DIR.
book_check_file="${BOOK_BUILD_DIR}/index.html"

if [ -d "${BOOK_BUILD_DIR}" ]; then
if [[ ! -d "${BOOK_BUILD_DIR}" ]]; then
echo "" >&2
echo "${bold}Warning: The book directory wasn't found!${normal}" >&2
echo "${bold}Warning: Not going to push the book to GitHub!${normal}" >&2
exit 1
elif [[ ! -f "${book_check_file}" ]]; then
echo "${bold}${book_check_file} not found!${normal}" >&2
echo "${bold}${BOOK_BUILD_DIR} is present though.${normal}" >&2
exit 1
else
echo "${bold}Cloning the website repo...${normal}"
git clone -b "${DOCS_BRANCH_NAME}" https://git@"${GH_REPO_REF}"
rm -rf ./"${DOCS_REPO_NAME}"/*
Expand All @@ -52,9 +62,4 @@ if [ -d "${BOOK_BUILD_DIR}" ]; then
-m "Commit: ${TRAVIS_COMMIT}" || ret=$?
git push "https://${GH_TOKEN}@${GH_REPO_REF}"
popd
else
echo "" >&2
echo "${bold}Warning: The book wasn't found!${normal}" >&2
echo "${bold}Warning: Not going to push the book to GitHub!${normal}" >&2
exit 1
fi