This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/.travisci/pub_prep.sh

86 lines
2.2 KiB
Bash
Raw Normal View History

2018-05-19 20:42:12 +00:00
#!/usr/bin/env bash
## Documentation publishing preparation script for Travis CI integration
##
## Copyright (c) 2012-2014 Sylvain Benner
## Copyright (c) 2014-2018 Sylvain Benner & Contributors
##
## Author: Eugene Yaremenko
## URL: https://github.com/syl20bnr/spacemacs
##
## This file is not part of GNU Emacs.
##
## License: GPLv3
2018-10-13 08:47:20 +00:00
fold_start() {
echo -e "travis_fold:start:$1\033[33;1m$2\033[0m"
2018-05-19 20:42:12 +00:00
}
2018-10-13 08:47:20 +00:00
fold_end() {
echo -e "\ntravis_fold:end:$1\r"
}
mkdir -p ~/.ssh
printf "Host github.com\n" > ~/.ssh/config
printf " StrictHostKeyChecking no\n" >> ~/.ssh/config
printf " UserKnownHostsFile=/dev/null\n" >> ~/.ssh/config
2018-10-13 08:47:20 +00:00
fold_start "FORMATTING_DOCUMENTATION"
docker run --rm \
-v "${TRAVIS_BUILD_DIR}/.ci/spacedoc-cfg.edn":/opt/spacetools/spacedoc-cfg.edn \
-v "${TRAVIS_BUILD_DIR}":/tmp/docs/ \
2018-10-13 08:47:20 +00:00
jare/spacetools docfmt /tmp/docs/
if [ $? -ne 0 ]; then
echo "Formatting failed."
exit 2
fi
fold_end "FORMATTING_DOCUMENTATION"
2018-05-19 20:42:12 +00:00
rm -rf ~/.emacs.d
mv "${TRAVIS_BUILD_DIR}" ~/.emacs.d
cd ~/.emacs.d
2018-10-13 08:47:20 +00:00
cp ./.travisci/.spacemacs ~/
ln -sf ~/.emacs.d "${TRAVIS_BUILD_DIR}"
2018-05-19 20:42:12 +00:00
2018-10-13 08:47:20 +00:00
fold_start "INSTALLING_${EVM_EMACS}"
2018-05-19 20:42:12 +00:00
curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw \
> /tmp/x.sh && source /tmp/x.sh
evm install $EVM_EMACS --use --skip
if [ $? -ne 0 ]; then
echo "Installation failed"
exit 2
fi
2018-10-13 08:47:20 +00:00
fold_end "INSTALLING_${EVM_EMACS}"
2018-05-19 20:42:12 +00:00
2018-10-13 08:47:20 +00:00
fold_start "INSTALLING_DEPENDENCIES"
emacs -batch -l init.el
2018-05-19 20:42:12 +00:00
if [ $? -ne 0 ]; then
echo "Dependencies installation failed."
exit 2
fi
2018-10-13 08:47:20 +00:00
fold_end "INSTALLING_DEPENDENCIES"
2018-05-19 20:42:12 +00:00
2018-10-13 08:47:20 +00:00
fold_start "EXPORTING_DOCUMENTATION"
2018-05-19 23:36:09 +00:00
emacs -batch -l init.el -l core/core-documentation.el \
-f spacemacs/publish-doc
if [ $? -ne 0 ]; then
echo "spacemacs/publish-doc failed"
exit 2
fi
2018-10-13 08:47:20 +00:00
fold_end "EXPORTING_DOCUMENTATION"
fold_start "INSTALLING_HUB"
hub_version="2.5.1"
2018-10-13 08:47:20 +00:00
hub_url="https://github.com/github/hub/releases/download/"
hub_url+="v${hub_version}/hub-linux-amd64-${hub_version}.tgz"
curl -L $hub_url | tar \
--strip-components=2 \
-xz \
--wildcards \
-C /tmp/ \
"*hub"
if [ $? -ne 0 ]; then
echo "Hub installation failed."
exit 2
fi
fold_end "INSTALLING_HUB"