Skip to content

Commit

Permalink
further improve autogenrate-settings.sh, it should fail if settings a…
Browse files Browse the repository at this point in the history
…ren't generated
  • Loading branch information
Blargian committed Feb 1, 2025
1 parent b466b9f commit 2b3cef6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions scripts/settings/autogenerate-settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ script_path="$tmp_dir/$script_filename"

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

yes | bash "$script_path" install || { echo "Failed to execute script"; exit 1; }
echo "[$SCRIPT_NAME] Auto-generating settings"

# Autogenerate Format settings
./clickhouse -q "
"$script_path" -q "
WITH
'FormatFactorySettings.h' AS cpp_file,
settings_from_cpp AS
Expand Down Expand Up @@ -63,10 +62,10 @@ These settings are autogenerated from [source](https://github.com/ClickHouse/Cli
' AS prefix
SELECT prefix || (SELECT groupConcat(*) FROM main_content)
INTO OUTFILE '../../docs/en/operations/settings/settings-formats.md' TRUNCATE FORMAT LineAsString
"
" || { echo "Failed to Autogenerate Format settings"; exit 1; }

# Autogenerate settings
./clickhouse -q "
"$script_path" -q "
WITH
'Settings.cpp' AS cpp_file,
settings_from_cpp AS
Expand Down Expand Up @@ -98,9 +97,9 @@ All below settings are also available in table [system.settings](/docs/en/operat
' AS prefix
SELECT prefix || (SELECT groupConcat(*) FROM main_content)
INTO OUTFILE '../../docs/en/operations/settings/settings.md' TRUNCATE FORMAT LineAsString
"
" || { echo "Failed to Autogenerate Core settings"; exit 1; }

echo "[$SCRIPT_NAME] Auto-generation of settings markdown pages completed"
echo "[$SCRIPT_NAME] Auto-generation of settings markdown pages completed successfully"

# perform cleanup
rm -rf clickhouse
Expand Down

0 comments on commit 2b3cef6

Please sign in to comment.