Skip to content

Commit

Permalink
Add new docs deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsondatadev committed Oct 18, 2023
1 parent 16c2af4 commit 6e9949c
Show file tree
Hide file tree
Showing 86 changed files with 13,722 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.cache
tmp/
site
!./site

# intellij files
.idea
Expand Down
57 changes: 57 additions & 0 deletions site/.github/bin/deploy_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

while [[ "$#" -gt 0 ]]; do
case $1 in
-v|--version) ICEBERG_VERSION="$2"; shift ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done

GIT_BRANCH="docs-${ICEBERG_VERSION}"

# change to branch
git checkout -b $GIT_BRANCH

cd ..

# remove all files and directories minus exceptions
find . \
-not \( -path . \) \
-not \( -path .. \) \
-not \( -path ./.git -prune \) \
-not \( -path ./.github -prune \) \
-not \( -path ./docs-new -prune \) \
! -name LICENSE \
! -name NOTICE \
-exec rm -rf {} +

# move the nightly docs to the root and change from 'nightly'
mv docs-new ./tmp && \
mv ./tmp/docs/docs/nightly/* . && \
rm -r ./tmp

#delete top-level directories
rm -r ./docs-new

# update versions in mkdocs.yml
sed -i '' -E "s/(^site\_name:[[:space:]]+docs\/).*$/\1${ICEBERG_VERSION}/" "./mkdocs.yml"
sed -i '' -E "s/(^[[:space:]]*-[[:space:]]+Javadoc:.*\/javadoc\/)nightly/\1${ICEBERG_VERSION}/" "./mkdocs.yml"

cd docs

# add exclude search for older documentation
python3 -c "import os
for f in filter(lambda x: x.endswith('.md'), os.listdir()): lines = open(f).readlines(); open(f, 'w').writelines(lines[:2] + ['search:\n', ' exclude: true\n'] + lines[2:]);"

cd ..

git add .

git commit -m "Deploy ${GIT_BRANCH} branch"

git push origin $GIT_BRANCH

git checkout main

git reset --hard origin/main
67 changes: 67 additions & 0 deletions site/.github/bin/deploy_docs.sh.orig
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash

while [[ "$#" -gt 0 ]]; do
case $1 in
-v|--version) ICEBERG_VERSION="$2"; shift ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done

GIT_BRANCH="docs-${ICEBERG_VERSION}"

# change to branch
git checkout -b $GIT_BRANCH

cd ..

<<<<<<< HEAD
#remove all all files and directories except the docs/ folder
find . -type f -exec rm -f {} +
find . ! -name 'docs-new' -type d -exec rm -rf {} +
=======
# remove all files and directories except the exceptions
find . \
-not \( -path . \) \
-not \( -path .. \) \
-not \( -path ./.git -prune \) \
-not \( -path ./.github -prune \) \
-not \( -path ./docs-new -prune \) \
! -name LICENSE \
! -name NOTICE \
-exec rm -rf {} +
>>>>>>> e5cc60e09 (Future squash)

# move the nightly docs to the root and change from 'nightly'
mv docs-new ./tmp && \
mv ./tmp/docs/docs/nightly/* . && \
rm -r ./tmp

#delete top-level directories
rm -r ./docs-new

# update versions in mkdocs.yml
sed -i '' -E "s/(^site\_name:[[:space:]]+docs\/).*$/\1${ICEBERG_VERSION}/" "./mkdocs.yml"
sed -i '' -E "s/(^[[:space:]]*-[[:space:]]+Javadoc:.*\/javadoc\/)nightly/\1${ICEBERG_VERSION}/" "./mkdocs.yml"

cd docs

# add exclude search for older documentation
python3 -c "import os
<<<<<<< HEAD
for f in filter(lambda x: x.endswith('.md'), os.listdir('.')): lines = open(f).readlines(); open(f, 'w').writelines(lines[:2] + ['search:\n', ' exclude: true\n'] + lines[2:]);"
=======
for f in filter(lambda x: x.endswith('.md'), os.listdir()): lines = open(f).readlines(); open(f, 'w').writelines(lines[:2] + ['search:\n', ' exclude: true\n'] + lines[2:]);"
cd ..
>>>>>>> e5cc60e09 (Future squash)
git add .
git commit -m "Deploy ${GIT_BRANCH} branch"
git push origin $GIT_BRANCH
git checkout master
git reset --hard origin/master
119 changes: 119 additions & 0 deletions site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
## Temp remove for first phase
.github/workflows/

## MkDocs
/site/

## Vale
.github/vale/
.vale.ini

## MacOS

# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

## Linux

*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

## Eclipse

.metadata
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# PyDev specific (Python IDE for Eclipse)
*.pydevproject

# CDT-specific (C/C++ Development Tooling)
.cproject

# CDT- autotools
.autotools

# Java annotation processor (APT)
.factorypath

# PDT-specific (PHP Development Tools)
.buildpath

# sbteclipse plugin
.target

# Tern plugin
.tern-project

# TeXlipse plugin
.texlipse

# STS (Spring Tool Suite)
.springBeans

# Code Recommenders
.recommenders/

# Annotation Processing
.apt_generated/
.apt_generated_test/

# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet

# Project description file.
# Typically, this file would be tracked if it contains build/dependency configurations:
.project



Loading

0 comments on commit 6e9949c

Please sign in to comment.