forked from apache/flink-cdc
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-34180] Migrate doc website from ververica to flink (apache#3028)
- Loading branch information
1 parent
86272bf
commit 1dc201f
Showing
214 changed files
with
15,577 additions
and
5,194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,33 +13,73 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: build_docs | ||
|
||
# execute this docs build workflow automatically when new push happens in any branch | ||
name: "Build documentation" | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'docs/**' | ||
|
||
branches: | ||
- master | ||
- release-* | ||
schedule: | ||
- cron: '0 0 * * *' # Deploy every day | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
build_docs_job: | ||
build-documentation: | ||
if: github.repository == 'apache/flink-cdc' | ||
runs-on: ubuntu-latest | ||
container: debian:buster-slim | ||
|
||
strategy: | ||
max-parallel: 1 | ||
matrix: | ||
branch: | ||
- master | ||
- release-3.0 | ||
|
||
steps: | ||
|
||
- name: Prereqs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
apt-get update | ||
apt-get install -y git | ||
git clone "https://token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" . | ||
shell: bash | ||
|
||
- name: Execute script to build our documentation and update pages | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: "docs/build_docs.sh" | ||
shell: bash | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ matrix.branch }} | ||
|
||
- name: Set branch environment variable | ||
run: | | ||
currentBranch=$(git branch --show-current) | ||
echo "flink_branch=${currentBranch}" >> ${GITHUB_ENV} | ||
if [ "${currentBranch}" = "master" ]; then | ||
echo "flink_alias=release-3.1" >> ${GITHUB_ENV} | ||
elif [ "${currentBranch}" = "release-3.0" ]; then | ||
echo "flink_alias=stable" >> ${GITHUB_ENV} | ||
fi | ||
- name: Build documentation | ||
run: | | ||
docker run --rm --volume "$PWD:/root/flink-cdc" chesnay/flink-ci:java_8_11_17_21_maven_386 bash -c "cd /root/flink-cdc && chmod +x ./.github/workflows/docs.sh && ./.github/workflows/docs.sh" | ||
- name: Upload documentation | ||
uses: burnett01/[email protected] | ||
with: | ||
switches: --archive --compress | ||
path: docs/target/ | ||
remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/flink/flink-cdc-docs-${{ env.flink_branch }}/ | ||
remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }} | ||
remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }} | ||
remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }} | ||
remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }} | ||
|
||
- name: Upload documentation alias | ||
if: env.flink_alias != '' | ||
uses: burnett01/[email protected] | ||
with: | ||
switches: --archive --compress | ||
path: docs/target/ | ||
remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/flink/flink-cdc-docs-${{ env.flink_alias }}/ | ||
remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }} | ||
remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }} | ||
remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }} | ||
remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/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. | ||
################################################################################ | ||
set -e | ||
|
||
mvn --version | ||
java -version | ||
javadoc -J-version | ||
|
||
# workaround for a git security patch | ||
git config --global --add safe.directory /root/flink-cdc | ||
git submodule update --init --recursive | ||
|
||
HUGO_REPO=https://github.com/gohugoio/hugo/releases/download/v0.80.0/hugo_extended_0.80.0_Linux-64bit.tar.gz | ||
HUGO_ARTIFACT=hugo_extended_0.80.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 | ||
|
||
# Build the docs | ||
hugo --source docs | ||
|
||
# generate docs into docs/target | ||
hugo -v --source docs --destination target | ||
if [ $? -ne 0 ]; then | ||
echo "Error building the docs" | ||
exit 1 | ||
fi | ||
|
||
# build Flink; required for Javadoc step | ||
mvn clean install -B -DskipTests -Dfast | ||
|
||
# build java/scala docs | ||
mkdir -p docs/target/api | ||
mvn javadoc:aggregate -B \ | ||
-DadditionalJOption="-Xdoclint:none --allow-script-in-comments" \ | ||
-Dmaven.javadoc.failOnError=false \ | ||
-Dcheckstyle.skip=true \ | ||
-Dspotless.check.skip=true \ | ||
-Denforcer.skip=true \ | ||
-Dheader="<a href=\"http://flink.apache.org/\" target=\"_top\"><h1>Back to Flink Website</h1></a> <script>var _paq=window._paq=window._paq||[];_paq.push([\"disableCookies\"]),_paq.push([\"setDomains\",[\"*.flink.apache.org\",\"*.nightlies.apache.org/flink\"]]),_paq.push([\"trackPageView\"]),_paq.push([\"enableLinkTracking\"]),function(){var u=\"//matomo.privacy.apache.org/\";_paq.push([\"setTrackerUrl\",u+\"matomo.php\"]),_paq.push([\"setSiteId\",\"1\"]);var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s)}();</script>" | ||
mv target/site/apidocs docs/target/api/java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "docs/themes/book"] | ||
path = docs/themes/book | ||
url = https://github.com/alex-shpak/hugo-book |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.bundle/ | ||
.jekyll-metadata | ||
.jekyll-cache/ | ||
.rubydeps/ | ||
ruby2/.bundle/ | ||
ruby2/.rubydeps/ | ||
public/ | ||
resources/ | ||
.hugo_build.lock | ||
.DS_Store |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.