website: website source code / content split (#1838)

This commit is contained in:
Bryce Kalow authored and GitHub committed 2022-04-11 14:46:36 -05:00
1 parent 06c13064cc
commit 7f69e935bf
116 files changed
+2980 -18557

No files matched your search

-3
View File
@@ -1,3 +0,0 @@
const { indexDocsContent } = require('@hashicorp/react-search/tools')
indexDocsContent()
+31
View File
@@ -0,0 +1,31 @@
# Repo which we are cloning and executing npm run build:deploy-preview within
REPO_TO_CLONE=dev-portal
# Set the subdirectory name for the base project
PREVIEW_DIR=website-preview
# The directory we want to clone the project into
CLONE_DIR=website-preview
# The product for which we are building the deploy preview
PRODUCT=boundary
from_cache=false
if [ -d "$PREVIEW_DIR" ]; then
echo "$PREVIEW_DIR found"
CLONE_DIR="$PREVIEW_DIR-tmp"
from_cache=true
fi
# Clone the base project, if needed
echo "⏳ Cloning the $REPO_TO_CLONE repo, this might take a while..."
git clone --depth=1 "https://github.com/hashicorp/$REPO_TO_CLONE.git" "$CLONE_DIR"
if [ "$from_cache" = true ]; then
echo "Setting up $PREVIEW_DIR"
cp -R "./$CLONE_DIR/." "./$PREVIEW_DIR"
fi
# cd into the preview directory project
cd "$PREVIEW_DIR"
# Run the build:deploy-preview start script
REPO=$PRODUCT DEV_IO=$PRODUCT IS_CONTENT_PREVIEW=true HASHI_ENV=project-preview npm run build:deploy-preview
+25
View File
@@ -0,0 +1,25 @@
# Set the subdirectory name for the dev-portal app
PREVIEW_DIR=website-preview
# The product for which we are running local preview mode
PRODUCT=boundary
should_pull=true
# Clone the dev-portal project, if needed
if [ ! -d "$PREVIEW_DIR" ]; then
echo "⏳ Cloning the dev-portal repo, this might take a while..."
git clone --depth=1 https://github.com/hashicorp/dev-portal.git "$PREVIEW_DIR"
should_pull=false
fi
cd "$PREVIEW_DIR"
# If the directory already existed, pull to ensure the dev-portal clone is fresh
if [ "$should_pull" = true ] && [ -d ".git" ]; then
git fetch origin main
git reset --hard origin/main
fi
# Run the dev-portal content-repo start script
REPO=$PRODUCT PREVIEW_DIR="$PREVIEW_DIR" npm run start:local-preview