Skip to content

Commit

Permalink
improve autogenerate-settings.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Blargian committed Feb 1, 2025
1 parent a5a10a3 commit 927a5c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"autogen_needed_files": "src/Core/FormatFactorySettings.h src/Core/Settings.cpp CHANGELOG.md"
},
"scripts": {
"build": "yarn copy-clickhouse-repo-docs && yarn generate-changelog && yarn auto-generate-settings && yarn build-api-doc && docusaurus build && yarn build-swagger && yarn cleanup-after-build",
"build": "yarn copy-clickhouse-repo-docs && yarn generate-changelog && yarn autogenerate-settings && yarn build-api-doc && docusaurus build && yarn build-swagger && yarn cleanup-after-build",
"clear": "docusaurus clear && bash ./placeholderReset.sh",
"deploy": "docusaurus deploy",
"docusaurus": "docusaurus",
Expand All @@ -17,10 +17,10 @@
"build-api-doc": "node clickhouseapi.js",
"build-swagger": "npx @redocly/cli build-docs https://api.clickhouse.cloud/v1 --output build/en/cloud/manage/api/swagger.html",
"prep-from-local" : "bash ./scripts/copy-clickhouse-repo-docs.sh -l $1",
"auto-generate-settings": "bash ./scripts/settings/autogenerate-settings.sh",
"autogenerate-settings": "bash ./scripts/settings/autogenerate-settings.sh",
"generate-changelog": "bash ./scripts/generate-changelog.sh",
"cleanup-after-build": "bash ./scripts/cleanup-after-build.sh",
"new-build": "yarn copy-clickhouse-repo-docs && yarn generate-changelog && yarn auto-generate-settings && yarn build-api-doc && docusaurus build && yarn build-swagger && yarn cleanup-after-build",
"new-build": "yarn copy-clickhouse-repo-docs && yarn generate-changelog && yarn autogenerate-settings && yarn build-api-doc && docusaurus build && yarn build-swagger && yarn cleanup-after-build",
"start": "docusaurus start",
"swizzle": "docusaurus swizzle",
"write-heading-ids": "docusaurus write-heading-ids",
Expand Down
15 changes: 9 additions & 6 deletions scripts/settings/autogenerate-settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,20 @@ fi
target_dir=$(dirname "$(dirname "$(realpath "$0")")")
file="$target_dir/settings/clickhouse-temp"
SCRIPT_NAME=$(basename "$0")
tmp_dir="$target_dir/tmp"

cd "$target_dir/tmp" || exit
mkdir -p "$tmp_dir" || exit 1
cd "$tmp_dir" || exit

script_url="https://clickhouse.com/" # URL of the installation script
script_filename="clickhouse" # Choose a descriptive name
script_path="$tmp_dir/$script_filename"

# Install ClickHouse
curl https://clickhouse.com/ | sh
curl -L "$script_url" -o "$script_path" || { echo "Failed to download script"; exit 1; }
yes | bash "$script_path" || { echo "Failed to execute script"; exit 1; }

echo "[$SCRIPT_NAME] Auto-generating settings"
cd .. || exit
cd settings || exit
cd ..
cd tmp || exit

# Autogenerate Format settings
./clickhouse -q "
Expand Down

0 comments on commit 927a5c2

Please sign in to comment.