Skip to content

Commit

Permalink
[FLINK-30923][documentation] Provide single script for installing Hugo (
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBrzezenski authored Aug 23, 2023
1 parent 9805724 commit 5c1e9f3
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 20 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
27 changes: 27 additions & 0 deletions docs/setup_hugo.sh
Original file line number Diff line number Diff line change
@@ -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
13 changes: 2 additions & 11 deletions tools/ci/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5c1e9f3

Please sign in to comment.