Skip to content

Commit

Permalink
Tighten docs publishing flow (#12572) (#12594)
Browse files Browse the repository at this point in the history
(cherry picked from commit ede19ef)

Co-authored-by: Dan Albert <dan@solana.com>
  • Loading branch information
mergify[bot] and danpaul000 committed Sep 30, 2020
1 parent 700c8c1 commit d13694d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ jobs:
- ~/.npm

before_install:
- .travis/channel_restriction.sh edge beta || travis_terminate 0
- .travis/affects.sh docs/ .travis || travis_terminate 0
- cd docs/
- source .travis/before_install.sh
Expand Down
17 changes: 17 additions & 0 deletions .travis/channel_restriction.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# Only proceed if we are on one of the channels passed in when calling this file
#

set -ex

eval "$(ci/channel-info.sh)"

for acceptable_channel in "$@"; do
if [[ "$CHANNEL" == "$acceptable_channel" ]]; then
exit 0
fi
done

echo "Not running from one of the following channels: $*"
exit 1
20 changes: 2 additions & 18 deletions docs/set-solana-release-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,9 @@ set -e

cd "$(dirname "$0")"

if [[ -n $CI_TAG ]]; then
LATEST_SOLANA_RELEASE_VERSION=$CI_TAG
elif [[ -z $CI_PULL_REQUEST ]]; then
LATEST_SOLANA_RELEASE_VERSION=$(\
curl -sSfL https://api.github.com/repos/solana-labs/solana/releases/latest \
| grep -m 1 tag_name \
| sed -ne 's/^ *"tag_name": "\([^"]*\)",$/\1/p' \
)
else
# Don't bother the `api.github.com` on pull requests to avoid getting rate
# limited
LATEST_SOLANA_RELEASE_VERSION=unknown-version
fi

if [[ -z "$LATEST_SOLANA_RELEASE_VERSION" ]]; then
echo Error: release version not defined
exit 1
fi
eval "$(../ci/channel-info.sh)"

LATEST_SOLANA_RELEASE_VERSION=$BETA_CHANNEL_LATEST_TAG
VERSION_FOR_DOCS_RS="${LATEST_SOLANA_RELEASE_VERSION:1}"

set -x
Expand Down

0 comments on commit d13694d

Please sign in to comment.