Merge pull request #11310 from ToolJet/docs/fix-render

[docs]: update render versions
This commit is contained in:
Adish M 2024-11-13 16:49:03 +05:30 committed by GitHub
commit 5180af74b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 22 deletions

View file

@ -53,7 +53,7 @@ jobs:
],
"serviceDetails": {
"pullRequestPreviewsEnabled": "no",
"buildCommand": "bash build-latest-version.sh",
"buildCommand": "npm i && npm run build",
"publishPath": "build/",
"url": "https://tooljet-pr-${{ env.PR_NUMBER }}.onrender.com"
}

View file

@ -1,31 +1,17 @@
#!/bin/bash
set -e
CONFIG_FILE="docusaurus.config.js"
VERSIONS_FILE="versions.json"
# Extract lastVersion from docusaurus.config.js using sed
LAST_VERSION=$(sed -n "s/.*lastVersion: *'\\([^']*\\)'.*/\\1/p" "$CONFIG_FILE")
if [ -z "$LAST_VERSION" ]; then
echo "Error: lastVersion not found in $CONFIG_FILE"
# Ensure versions.json exists
if [ ! -f "$VERSIONS_FILE" ]; then
echo "Error: $VERSIONS_FILE not found."
exit 1
fi
echo "Found lastVersion: $LAST_VERSION"
# Extract all version numbers from the entire file
ALL_VERSIONS=$(grep -oE "'[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z]+)?'" "$CONFIG_FILE" | sed "s/'//g" | sort -u -V -r)
if [ -z "$ALL_VERSIONS" ]; then
echo "Error: No versions found in $CONFIG_FILE"
exit 1
fi
echo "Found raw versions:"
echo "$ALL_VERSIONS"
# Convert the extracted versions into a JSON array format
VERSION_ARRAY=$(echo "$ALL_VERSIONS" | jq -R -s -c 'split("\n")[:-1] + ["'"$LAST_VERSION"'"] | unique')
echo "Updating versions.json with: $VERSION_ARRAY"
# Update versions.json with combined data
echo $VERSION_ARRAY | jq . > versions.json
# Output existing versions from versions.json for reference
echo "Using versions from $VERSIONS_FILE:"
jq . "$VERSIONS_FILE"
# Install dependencies and build the project
npm i && npm run build