Skip to content

Commit

Permalink
apacheGH-37858: [Docs][JS] Fix check of remote URL to generate JS docs (
Browse files Browse the repository at this point in the history
apache#37870)

### Rationale for this change

JS Docs are currently not being generated.

### What changes are included in this PR?

Use a regex check instead of an equality to cover both remote set with `.git` and without for upstream. Added also a fix to generate docs from origin from forks if necessary.

### Are these changes tested?

Via archery

### Are there any user-facing changes?
No
* Closes: apache#37858

Authored-by: Raúl Cumplido <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
raulcd authored and dgreiss committed Feb 17, 2024
1 parent b0fc673 commit 336ea3f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ci/scripts/js_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ yarn lint:ci
yarn build

if [ "${BUILD_DOCS_JS}" == "ON" ]; then
if [ "$(git config --get remote.origin.url)" == "https://github.com/apache/arrow.git" ]; then
yarn doc
elif [ "$(git config --get remote.upstream.url)" == "https://github.com/apache/arrow.git" ]; then
yarn doc --gitRemote upstream
elif [ "$(git config --get remote.apache.url)" == "[email protected]:apache/arrow.git" ]; then
# If apache or upstream are defined use those as remote.
# Otherwise use origin which could be a fork on PRs.
if [ "$(git config --get remote.apache.url)" == "[email protected]:apache/arrow.git" ]; then
yarn doc --gitRemote apache
elif [[ "$(git config --get remote.upstream.url)" =~ "https://github.com/apache/arrow" ]]; then
yarn doc --gitRemote upstream
elif [[ "$(basename -s .git $(git config --get remote.origin.url))" == "arrow" ]]; then
yarn doc
else
echo "Failed to build docs because the remote is not set correctly. Please set the origin or upstream remote to https://github.com/apache/arrow.git or the apache remote to [email protected]:apache/arrow.git."
exit 0
Expand Down

0 comments on commit 336ea3f

Please sign in to comment.