[docs][ci] skip usage doc build for non-deploys (#31063)
* build: skip cli usage doc build for non-deploys * fix: checking for CI * chore: removed trailing whitespace * fix: apease buildkite
This commit is contained in:
parent
1f67591e21
commit
768405c410
|
@ -3,6 +3,29 @@ set -e
|
|||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# shellcheck source=ci/env.sh
|
||||
source ../ci/env.sh
|
||||
|
||||
# Get current channel
|
||||
eval "$(../ci/channel-info.sh)"
|
||||
|
||||
# set the output file' location
|
||||
out=${1:-src/cli/usage.md}
|
||||
|
||||
# load the usage file's header
|
||||
cat src/cli/.usage.md.header > "$out"
|
||||
|
||||
# Skip generating the usage doc for non deployment commits of the docs
|
||||
if [[ -n $CI ]]; then
|
||||
if [[ $CI_BRANCH != $EDGE_CHANNEL* ]] && [[ $CI_BRANCH != $BETA_CHANNEL* ]] && [[ $CI_BRANCH != $STABLE_CHANNEL* ]]; then
|
||||
echo "**NOTE:** The usage doc is only auto-generated during full production deployments of the docs"
|
||||
echo "**NOTE:** This usage doc is auto-generated during deployments" >> "$out"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
echo 'Building the solana cli from source...'
|
||||
|
||||
# shellcheck source=ci/rust-version.sh
|
||||
source ../ci/rust-version.sh stable
|
||||
|
||||
|
@ -13,10 +36,6 @@ cargo build -p solana-cli
|
|||
|
||||
usage=$(cargo -q run -p solana-cli -- -C ~/.foo --help | sed -e 's|'"$HOME"'|~|g' -e 's/[[:space:]]\+$//')
|
||||
|
||||
out=${1:-src/cli/usage.md}
|
||||
|
||||
cat src/cli/.usage.md.header > "$out"
|
||||
|
||||
section() {
|
||||
declare mark=${2:-"###"}
|
||||
declare section=$1
|
||||
|
|
Loading…
Reference in New Issue