solana/ci/publish-docs.sh

32 lines
741 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -e
2018-11-08 22:19:51 -08:00
cd "$(dirname "$0")/.."
me=$(basename "$0")
2019-12-23 17:17:43 -08:00
echo --- update gitbook-cage
if [[ -n $CI_BRANCH ]]; then
(
set -x
(
. ci/rust-version.sh stable
ci/docker-run.sh "$rust_stable_docker_image" make -C docs -B svg
2019-12-23 17:17:43 -08:00
)
# make a local commit for the svgs
git add -A -f docs/src/.gitbook/assets/.
2019-12-23 17:17:43 -08:00
if ! git diff-index --quiet HEAD; then
git config user.email maintainers@solana.com
git config user.name "$me"
git commit -m "gitbook-cage update $(date -Is)"
git push -f git@github.com:solana-labs/solana-gitbook-cage.git HEAD:refs/heads/"$CI_BRANCH"
# pop off the local commit
git reset --hard HEAD~
fi
)
else
2019-12-23 21:56:42 -08:00
echo CI_BRANCH not set
fi
2018-11-08 22:19:51 -08:00
exit 0