Use patches to fix docs
This commit is contained in:
parent
9f5e76e091
commit
96546ceb4e
|
@ -26,7 +26,7 @@ deploy:
|
||||||
branch: develop
|
branch: develop
|
||||||
# Deploy only if we are in the official repo and
|
# Deploy only if we are in the official repo and
|
||||||
# the local revision matches origin's head
|
# the local revision matches origin's head
|
||||||
condition: $TRAVIS_REPO_SLUG = $SPACEMACS_REPO_SLUG && $(git remote update) && $(git rev-parse '@') = $(git rev-parse '@{u}')
|
condition: $TRAVIS_REPO_SLUG = $SPACEMACS_REPO_SLUG && $(git remote update) && $(git rev-parse '@') = $(git rev-parse '@{u}') && $HAS_DOC_FIXES = true
|
||||||
- provider: script
|
- provider: script
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
script: ".travisci/pub_html.sh"
|
script: ".travisci/pub_html.sh"
|
||||||
|
|
|
@ -33,12 +33,6 @@ if [ `git rev-list HEAD...origin/$TRAVIS_BRANCH --count` != 0 ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git config --global user.name "${BOT_NAME}"
|
|
||||||
git config --global user.email "${BOT_EMAIL}"
|
|
||||||
git config --global push.default simple
|
|
||||||
git config --global hub.protocol https
|
|
||||||
export GITHUB_TOKEN=$BOT_TK
|
|
||||||
|
|
||||||
fold_start "CLONING_TARGET_REPOSITORY"
|
fold_start "CLONING_TARGET_REPOSITORY"
|
||||||
target_URL="https://github.com/${SPACEMACS_REPO_SLUG}.git"
|
target_URL="https://github.com/${SPACEMACS_REPO_SLUG}.git"
|
||||||
git clone "${target_URL}" -b "${TRAVIS_BRANCH}" "/tmp/${PUBLISH}"
|
git clone "${target_URL}" -b "${TRAVIS_BRANCH}" "/tmp/${PUBLISH}"
|
||||||
|
@ -48,22 +42,14 @@ if [ $? -ne 0 ]; then
|
||||||
fi
|
fi
|
||||||
fold_end "CLONING_TARGET_REPOSITORY"
|
fold_end "CLONING_TARGET_REPOSITORY"
|
||||||
|
|
||||||
fold_start "SELECTING_CHANGED_FILES"
|
fold_start "APPLYING DOCUMENTATION PATCH"
|
||||||
rsync -rv \
|
|
||||||
--include '*/' \
|
|
||||||
--include='*.org' \
|
|
||||||
--exclude='*' \
|
|
||||||
--prune-empty-dirs \
|
|
||||||
~/.emacs.d/ \
|
|
||||||
"/tmp/${PUBLISH}"
|
|
||||||
cd "/tmp/${PUBLISH}"
|
cd "/tmp/${PUBLISH}"
|
||||||
/tmp/hub add --all
|
git am < /tmp/docfmt.patch
|
||||||
/tmp/hub commit -m "documentation formatting: $(date -u)"
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Nothing to commit - exiting."
|
echo "Failed to apply documentation fixes patch"
|
||||||
exit 0
|
exit 2
|
||||||
fi
|
fi
|
||||||
fold_end "SELECTING_CHANGED_FILES"
|
fold_end "APPLYING DOCUMENTATION PATCH"
|
||||||
|
|
||||||
fold_start "PUSHING_CHANGES_TO_${BOT_NAME}/${PUBLISH}"
|
fold_start "PUSHING_CHANGES_TO_${BOT_NAME}/${PUBLISH}"
|
||||||
/tmp/hub fork
|
/tmp/hub fork
|
||||||
|
|
|
@ -24,6 +24,12 @@ printf "Host github.com\n" > ~/.ssh/config
|
||||||
printf " StrictHostKeyChecking no\n" >> ~/.ssh/config
|
printf " StrictHostKeyChecking no\n" >> ~/.ssh/config
|
||||||
printf " UserKnownHostsFile=/dev/null\n" >> ~/.ssh/config
|
printf " UserKnownHostsFile=/dev/null\n" >> ~/.ssh/config
|
||||||
|
|
||||||
|
git config --global user.name "${BOT_NAME}"
|
||||||
|
git config --global user.email "${BOT_EMAIL}"
|
||||||
|
git config --global push.default simple
|
||||||
|
git config --global hub.protocol https
|
||||||
|
export GITHUB_TOKEN=$BOT_TK
|
||||||
|
|
||||||
fold_start "FORMATTING_DOCUMENTATION"
|
fold_start "FORMATTING_DOCUMENTATION"
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v "${TRAVIS_BUILD_DIR}/.ci/spacedoc-cfg.edn":/opt/spacetools/spacedoc-cfg.edn \
|
-v "${TRAVIS_BUILD_DIR}/.ci/spacedoc-cfg.edn":/opt/spacetools/spacedoc-cfg.edn \
|
||||||
|
@ -35,6 +41,18 @@ if [ $? -ne 0 ]; then
|
||||||
fi
|
fi
|
||||||
fold_end "FORMATTING_DOCUMENTATION"
|
fold_end "FORMATTING_DOCUMENTATION"
|
||||||
|
|
||||||
|
fold_start "CREATING_DOCUMENTATION_PATCH_FILE"
|
||||||
|
git add --all
|
||||||
|
git commit -m "documentation formatting: $(date -u)"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Nothing to commit - exiting."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
export HAS_DOC_FIXES=true
|
||||||
|
git format-patch -1 HEAD --stdout > /tmp/docfmt.patch
|
||||||
|
cat /tmp/docfmt.patch
|
||||||
|
fold_end "CREATING_DOCUMENTATION_PATCH_FILE"
|
||||||
|
|
||||||
rm -rf ~/.emacs.d
|
rm -rf ~/.emacs.d
|
||||||
mv "${TRAVIS_BUILD_DIR}" ~/.emacs.d
|
mv "${TRAVIS_BUILD_DIR}" ~/.emacs.d
|
||||||
cd ~/.emacs.d
|
cd ~/.emacs.d
|
||||||
|
|
Loading…
Reference in a new issue