forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#27141 from ebullient/docs-build
Update docs website sync script
- Loading branch information
Showing
2 changed files
with
37 additions
and
6 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 |
---|---|---|
|
@@ -40,3 +40,4 @@ nb-configuration.xml | |
.jbang | ||
.sdkmanrc | ||
.envrc | ||
.jekyll-cache |
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 |
---|---|---|
@@ -1,29 +1,59 @@ | ||
#!/usr/bin/env bash | ||
|
||
git clone -b develop --single-branch [email protected]:quarkusio/quarkusio.github.io.git target/web-site | ||
# Make sure our working directory is where this script lives (docs directory of quarkus) | ||
SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
cd "${SCRIPTDIR}" | ||
|
||
# Invocation for sync + publish for a release | ||
# This will clone the website and then sync documents to the 'latest' for a release | ||
# | ||
# $ QUARKUS_WEB_SITE_PUSH=true QUARKUS_RELEASE=true ./sync-web-site.sh ${BRANCH} | ||
# | ||
# In quarkusio/quarkusio.github.io repo for nightly sync (.github/workflows/sync-main-doc.yml) | ||
# Both the branch and the target website directory are specified. | ||
# This will skip the website repo clone and will sync files into _versions, _generated_config, etc. | ||
# | ||
# $ .quarkus-main-repository/docs/sync-web-site.sh main ${PWD} | ||
# | ||
# For local development leave all arguments out. | ||
# This will clone the website repo clone and sync files into _versions, _generated_config, etc. | ||
# (use the version dropdown to select the nightly snapshot to preview changes) | ||
# | ||
# $ ./sync-web-site.sh | ||
|
||
if [ $# -eq 0 ]; then | ||
BRANCH="main" | ||
else | ||
BRANCH=$1 | ||
fi | ||
if [ $# -ge 2 ]; then | ||
TARGET_DIR=$2 | ||
fi | ||
|
||
if [ -z $TARGET_DIR ]; then | ||
TARGET_DIR=target/web-site | ||
git clone -b develop --single-branch [email protected]:quarkusio/quarkusio.github.io.git ${TARGET_DIR} | ||
fi | ||
|
||
if [[ $BRANCH == "main" ]]; then | ||
TARGET_GUIDES=target/web-site/_guides | ||
TARGET_CONFIG=target/web-site/_generated-config/latest | ||
if [ $BRANCH == "main" ] && [ "$QUARKUS_RELEASE" == "true" ]; then | ||
TARGET_GUIDES=${TARGET_DIR}/_guides | ||
TARGET_CONFIG=${TARGET_DIR}/_generated-config/latest | ||
else | ||
TARGET_GUIDES=target/web-site/_versions/${BRANCH}/guides | ||
TARGET_CONFIG=target/web-site/_generated-config/${BRANCH} | ||
TARGET_GUIDES=${TARGET_DIR}/_versions/${BRANCH}/guides | ||
TARGET_CONFIG=${TARGET_DIR}/_generated-config/${BRANCH} | ||
fi | ||
|
||
echo "Copying from src/main/asciidoc/* to $TARGET_GUIDES" | ||
rsync -vr --delete \ | ||
--exclude='**/*.html' \ | ||
--exclude='**/index.adoc' \ | ||
--exclude='**/attributes.adoc' \ | ||
--exclude='**/guides.md' \ | ||
--exclude='**/_templates' \ | ||
src/main/asciidoc/* \ | ||
$TARGET_GUIDES | ||
|
||
echo "\nCopying from ../target/asciidoc/generated/ to $TARGET_CONFIG" | ||
rsync -vr --delete \ | ||
--exclude='**/*.html' \ | ||
--exclude='**/index.adoc' \ | ||
|