-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simpler build scripts #1964
Simpler build scripts #1964
Conversation
Write to /var/log/proxysql.log by default, and add a logrotate script which manages this path. Unfortunately, the logrotate script can't use `PROXYSQL FLUSH LOGS;` to tell ProxySQL to rotate file handles*, so we use copytruncate instead. It would be nice if ProxySQL could rotate file handles following a signal in future... * For two reasons: 1. There's no safe / standard way to find admin credentials 2. mysql(1) client may not be installed
This adds an error message to `make install/uninstall` on "unsupported" distros. The behaviour is the same as before (do nothing, successfully).
The build scripts for all three packaging targets are identical except for their Make targets. Unify them, and pass in a new environment variable PROXYSQL_BUILD_TYPE to define the build type we want. The build scripts are updated to automatically exit if any command fails (`set -e`), so the "&& \" pattern is no longer required. We also `set -u` to protect against any variable being accidentally unset.
We don't need the `&& \` pattern any more now that `set -e` is defined at the top of the script. Also apply several defensive fixes suggested by the Shellcheck linter (https://github.com/koalaman/shellcheck).
Also, I based this on top of #1963, so it includes that change |
Automated message: PR pending admin approval for build testing |
This is really great @alexjurkiewicz thank you very much! It was on the todo list :) and it really does simplify making changes, I'm going to merge it into 2.0.3 and build the new release with the upgraded scripts. |
There is an issue with the script @alexjurkiewicz centos67_build_1 | /opt/entrypoint/entrypoint.bash: line 25: build_target[@]: unbound variable |
Sorry! I built the latest rhel/Deb scripts to test. I will investigate today. |
No problem, please make a PR against 2.0.4 since 2.0.3 is now released :) thanks again @alexjurkiewicz for your contribution! |
What branch name should I use? There isn't a v2.0.4 branch |
hi @alexjurkiewicz - I've pushed branch + tag for 2.0.4 |
The build scripts for all three packaging targets are identical except for their Make targets. Unify them, and pass in a new environment variable PROXYSQL_BUILD_TYPE to define the build type we want. The build scripts are updated to automatically exit if any command fails (`set -e`), so the "&& \" pattern is no longer required. We also `set -u` to protect against any variable being accidentally unset. We don't need the `&& \` pattern any more now that `set -e` is defined at the top of the script. Also apply several defensive fixes suggested by the Shellcheck linter (https://github.com/koalaman/shellcheck). Other small changes: * fix: Add missing directory to deb script cleanup * fix: cosmetics * fix: Don't define config file twice in RPM spec
This is a pretty invasive change to the build system, but I didn't see a good way to split it up.
There are two major improvements:
There are also a few minor fixes I found along the way:
make install
andmake uninstall
on unsupported OS (eg macOS)