diff --git a/.github/workflows/docs.sh b/.github/workflows/docs.sh index 34aa227d8c9d5..b8a088d31d1c9 100755 --- a/.github/workflows/docs.sh +++ b/.github/workflows/docs.sh @@ -22,19 +22,18 @@ mvn --version java -version javadoc -J-version -# setup hugo -HUGO_REPO=https://github.com/gohugoio/hugo/releases/download/v0.110.0/hugo_extended_0.110.0_Linux-64bit.tar.gz -HUGO_ARTIFACT=hugo_extended_0.110.0_Linux-64bit.tar.gz -if ! curl --fail -OL $HUGO_REPO ; then - echo "Failed to download Hugo binary" - exit 1 -fi -tar -zxvf $HUGO_ARTIFACT -C /usr/local/bin git submodule update --init --recursive -# Setup the external documentation modules + cd docs + +# setup hugo +source setup_hugo.sh + +# Setup the external documentation modules source setup_docs.sh + cd .. + # Build the docs hugo --source docs diff --git a/docs/README.md b/docs/README.md index a017f12f83796..bc59ea579eb9e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -27,6 +27,12 @@ $ docker run -v $(pwd):/src -p 1313:1313 jakejarvis/hugo-extended:latest server Make sure you have installed [Hugo](https://gohugo.io/getting-started/installing/) on your system. +```sh +$ ./setup_hugo.sh +``` + +Then build the docs from source: + ```sh $ ./build_docs.sh ``` diff --git a/docs/setup_hugo.sh b/docs/setup_hugo.sh new file mode 100644 index 0000000000000..5f3fa29028472 --- /dev/null +++ b/docs/setup_hugo.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +################################################################################ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ + +# setup hugo +HUGO_REPO=https://github.com/gohugoio/hugo/releases/download/v0.110.0/hugo_extended_0.110.0_Linux-64bit.tar.gz +HUGO_ARTIFACT=hugo_extended_0.110.0_Linux-64bit.tar.gz +if ! curl --fail -OL $HUGO_REPO ; then + echo "Failed to download Hugo binary" + exit 1 +fi +tar -zxvf $HUGO_ARTIFACT -C /usr/local/bin diff --git a/tools/ci/docs.sh b/tools/ci/docs.sh index e24e64c643c55..30e1ea89b8b30 100755 --- a/tools/ci/docs.sh +++ b/tools/ci/docs.sh @@ -17,23 +17,14 @@ # limitations under the License. ################################################################################ -HUGO_REPO=https://github.com/gohugoio/hugo/releases/download/v0.110.0/hugo_extended_0.110.0_Linux-64bit.tar.gz -HUGO_ARTIFACT=hugo_extended_0.110.0_Linux-64bit.tar.gz - -if ! curl --fail -OL $HUGO_REPO ; then - echo "Failed to download Hugo binary" - exit 1 -fi - -tar -zxvf $HUGO_ARTIFACT - git submodule update --init --recursive # Setup the external documentation modules cd docs +source setup_hugo.sh source setup_docs.sh cd .. # Build the docs -./hugo --source docs +hugo --source docs if [ $? -ne 0 ]; then echo "Error building the docs"