From b5455b689ab988a183d4edb6d104913c9a3c0efa Mon Sep 17 00:00:00 2001 From: Eric Berquist Date: Wed, 8 Jul 2020 09:24:34 -0400 Subject: [PATCH 1/2] Update Travis for HonKit build --- tools/deploy/update_site_travis.bash | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/deploy/update_site_travis.bash b/tools/deploy/update_site_travis.bash index cd923d985..22014dea4 100644 --- a/tools/deploy/update_site_travis.bash +++ b/tools/deploy/update_site_travis.bash @@ -33,14 +33,15 @@ 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 was moved to `build/` +# Assume the book has already been built, and was moved to `_book/` # inside the same directory as this script. +book_build_dir=_book -if [ -d build ]; then +if [ -d "${book_build_dir}" ]; then echo "${bold}Cloning the website repo...${normal}" git clone -b "${DOCS_BRANCH_NAME}" https://git@"${GH_REPO_REF}" rm -rf ./"${DOCS_REPO_NAME}"/* - cp -a ./build/* ./"${DOCS_REPO_NAME}" + cp -a ./"${book_build_dir}"/* ./"${DOCS_REPO_NAME}" pushd ./"${DOCS_REPO_NAME}" echo "www.algorithm-archive.org" > CNAME echo "${bold}Adding changes...${normal}" From 5620721b30de8284171e72710e5375c36ed2713d Mon Sep 17 00:00:00 2001 From: Eric Berquist Date: Wed, 8 Jul 2020 09:46:59 -0400 Subject: [PATCH 2/2] Fix HonKit build commands and location of book build dir --- .travis.yml | 16 ++-------------- tools/deploy/update_site_travis.bash | 8 +++----- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 567dfb2f7..c4dc98ab4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,22 +6,10 @@ node_js: - "12" before_script: - - mkdir -p "${TRAVIS_BUILD_DIR}"/build - - CHANGED_FILES=$(git diff --name-only HEAD~1...HEAD .) - - | - if echo $CHANGED_FILES | grep "package.json" - then - cp package.json "${TRAVIS_BUILD_DIR}"/build - fi + - BOOK_BUILD_DIR="${TRAVIS_BUILD_DIR}"/_book script: - - | - if echo $CHANGED_FILES | grep "package.json" - then - npm build --reload . ${TRAVIS_BUILD_DIR}/build - else - npm build . ${TRAVIS_BUILD_DIR}/build - fi + - npm run build after_success: - | diff --git a/tools/deploy/update_site_travis.bash b/tools/deploy/update_site_travis.bash index 22014dea4..5ab116ee7 100644 --- a/tools/deploy/update_site_travis.bash +++ b/tools/deploy/update_site_travis.bash @@ -33,15 +33,13 @@ 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 was moved to `_book/` -# inside the same directory as this script. -book_build_dir=_book +# Assume the book has already been built and lives in $BOOK_BUILD_DIR. -if [ -d "${book_build_dir}" ]; then +if [ -d "${BOOK_BUILD_DIR}" ]; then echo "${bold}Cloning the website repo...${normal}" git clone -b "${DOCS_BRANCH_NAME}" https://git@"${GH_REPO_REF}" rm -rf ./"${DOCS_REPO_NAME}"/* - cp -a ./"${book_build_dir}"/* ./"${DOCS_REPO_NAME}" + cp -a "${BOOK_BUILD_DIR}"/* ./"${DOCS_REPO_NAME}" pushd ./"${DOCS_REPO_NAME}" echo "www.algorithm-archive.org" > CNAME echo "${bold}Adding changes...${normal}"