-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade for the native protocols spec page
- Loading branch information
tengu-alt
committed
Aug 30, 2024
1 parent
dddece2
commit fc53c8c
Showing
5 changed files
with
121 additions
and
14 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
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,41 @@ | ||
#!/bin/bash | ||
|
||
# Exit immediately if a command exits with a non-zero status. | ||
set -e | ||
|
||
# Variables | ||
GO_VERSION="1.20.6" | ||
GO_TAR="go${GO_VERSION}.linux-amd64.tar.gz" | ||
GITHUB_REPO_PARSER="https://github.com/martin-sucha/cqlprotodoc.git" # Replace with the actual parser repo URL | ||
PARSER_DIR="/home/build/cqlprotodoc" | ||
WEBSITE_DIR="/home/build/cassandra-website" | ||
|
||
# Step 0: Download and install Go | ||
echo "Downloading Go $GO_VERSION..." | ||
wget https://golang.org/dl/$GO_TAR | ||
|
||
echo "Installing Go..." | ||
tar -C /usr/local -xzf $GO_TAR | ||
|
||
# Set Go environment variables | ||
export PATH=$PATH:/usr/local/go/bin | ||
export GOPATH=$HOME/go | ||
|
||
# Step 1: Clone the GitHub repo with the Go parser | ||
echo "Cloning the cqlprotodoc repository..." | ||
git clone "$GITHUB_REPO_PARSER" "$PARSER_DIR" | ||
|
||
# Step 2: Build the parser | ||
echo "Building the cqlprotodoc..." | ||
cd "$PARSER_DIR" | ||
go build -o cqlprotodoc | ||
|
||
# Step 3: Process the spec files using the parser | ||
echo "Processing the .spec files..." | ||
"$PARSER_DIR"/cqlprotodoc "$WEBSITE_DIR/site-content/source/modules/ROOT/examples/TEXT" "$WEBSITE_DIR/site-content/build/html/_" | ||
|
||
# Step 4: Cleanup - Remove the Cassandra and parser directories | ||
echo "Cleaning up..." | ||
rm -rf "$PARSER_DIR" /usr/local/go $GO_TAR | ||
|
||
echo "Script completed successfully." |
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