2018-11-11 08:19:04 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2018-11-08 22:19:51 -08:00
|
|
|
|
|
|
|
cd "$(dirname "$0")/.."
|
2019-12-17 14:29:46 -08:00
|
|
|
|
2020-04-22 09:51:01 -07:00
|
|
|
echo --- build docs
|
|
|
|
(
|
|
|
|
set -x
|
|
|
|
. ci/rust-version.sh stable
|
|
|
|
ci/docker-run.sh "$rust_stable_docker_image" docs/build.sh
|
|
|
|
)
|
2019-12-17 14:29:46 -08:00
|
|
|
|
2019-12-23 17:17:43 -08:00
|
|
|
echo --- update gitbook-cage
|
|
|
|
if [[ -n $CI_BRANCH ]]; then
|
|
|
|
(
|
2020-03-12 14:45:48 -07:00
|
|
|
# make a local commit for the svgs and generated/updated markdown
|
2020-04-22 09:51:01 -07:00
|
|
|
set -x
|
2020-03-12 14:45:48 -07:00
|
|
|
git add -f docs/src
|
2019-12-23 17:17:43 -08:00
|
|
|
if ! git diff-index --quiet HEAD; then
|
2020-06-13 14:41:05 -07:00
|
|
|
git config user.email maintainers@solana.foundation
|
2020-04-22 09:51:01 -07:00
|
|
|
git config user.name "$(basename "$0")"
|
2019-12-23 17:17:43 -08:00
|
|
|
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
|
|
|
|
)
|
2019-07-22 16:45:00 -07:00
|
|
|
else
|
2019-12-23 21:56:42 -08:00
|
|
|
echo CI_BRANCH not set
|
2019-07-22 16:45:00 -07:00
|
|
|
fi
|
2018-11-08 22:19:51 -08:00
|
|
|
|
|
|
|
exit 0
|