Universal install script
Having an interactive and non-interactive install script would be useful.
- The script must use
shand notbashfor portability - The script must accept arguments to run without interaction, see last step
- Each step needs validation checks: Was the command completed or not?
- Use one-liner to download and execute
a.
curl -sL https://sentry.io/get-cli/ | sh - Check if we have builds for the system it's executed on a. For manual reference see: https://relay.so/builds b. Check OS as well as architecture c. Abort if os/arch isn't supported and show system information blob, prompt user to open a PR on this repo
- Next, find all
phpbinaries a. Loop overPATHs and find binaries that contain*php*in the name b. Test if binary is aphpexecutable using--version? - Show user a list of found executables a. Show path + version + if that version is supported (7.4 — 8.2) b. Let user pick a binary to install Relay to
- Detect "ini dir" of php binary
- Detect "extension dir" of php binary
a.
php -i | grep '^extension_dir' - Check for needed PHP extensions (json, msgpack, igbinary) using
php -ma. Abort if any of them are missing and prompt user to install the ones that are missing - Check system dependencies
a.
zstd,lz4andopensslb. These libs are named differently on each system, we'll need checks for: Debian-based, CentOS-based, macOS-based and AlpineLinux-based systems c. If not found prompt user to install the package and abort - Download correct binary to
mktemp - Inject UUID
- Move
relay.soandrelay.inito ext/ini dirs - Verify installation was completed:
php --ri relayand UUID matches - Show confirmation message that Relay was installed
- Print instructions how to call script without user interaction for what they just chose
We now have an outline here: https://relay.so/docs/1.x/installation#manual-installation
@tillkruss openssl 1.1 specifically is need it right?, newer version of openssl is not supported correct? (this apply for all versions except the one for ubuntu/debian)
I am asking because alpine:3.17 shipped with openssl 3.0.7-r0
Aha, we might need to add builds for that then. Let's do Alpine 3.16 and older for now.
I have found the following:
- centos 8 will install openssl 1.1 by default.
- centos 7 will install openssl 1.0 by default.
- amazonlinux 2 will install openssl 1.0 by default.
- rockylinux 8 will install openssl 1.1 by default.
- rockylinux 9 will install openssl 3.0 by default.
- Ubuntu/Debian are the only one which have a build for
libssl3
So any other distro with openssl 3 (like rockylinux 9) will get an error message that we need openssl 1.1