Updated tools.func (markdown)

Michel Roegl-Brunner 2025-05-15 12:58:14 +02:00
parent ec2fa06962
commit c6c6b1ad86

@ -38,19 +38,16 @@ NODE_VERSION=20 NODE_MODULE="yarn@latest,@vue/cli-service@5.0.0" install_node_an
| `NODE_VERSION` | Specifies the major version of Node.js to install (e.g., `20`, `22`). | `22` |
| `NODE_MODULE` | Comma-separated list of global npm modules to install or update. <br>Examples: <br>`yarn@latest` <br>`@vue/cli-service@5.0.0` <br>`typescript` | *(empty)* |
### Notes
Global npm packages are only processed if NODE_MODULE is set.
If the requested module version is already installed, it is skipped.
Modules are updated if the installed version does not match the requested one (unless latest is used).
On failure, the script exits with exit 1.
---
## `install_postgresql`
### Overview
### Description
`install_postgresql()`:
This function installs or upgrades to a specified version of PostgreSQL. It handles backups, repository configuration, and service restarts automatically.
- Checks if Postgressql is installed.
- If Postgressql is installed but not the desired version, it replaces it.
- If Postgressql is not installed, it installs the specified version.
### Usage
@ -68,12 +65,41 @@ PG_VERSION=15 install_postgresql
|--------------|-----------------------------------------------------------------------------|---------------|
| `PG_VERSION` | Specifies the major version of PostgreSQL to install or upgrade to (e.g., `14`, `15`, `16`). | `16` |
### Behavior
- Backs up databases if an existing installation is detected.
- Installs the required version of PostgreSQL using the PGDG APT repo.
- Restores the database after upgrade if applicable.
---
## install_mariadb
### Description
- Detecting the current version of MariaDB (if installed)
- Upgrading to the latest version if needed
- Replacing older versions while preserving data
- Configuring the appropriate MariaDB APT repository
- Installing the MariaDB packages
## Usage
```bash
install_mariadb
```
You can optionally set the `MARIADB_VERSION` environment variable before calling the function to specify a particular version to install.
Example:
```bash
MARIADB_VERSION="10.11.6" install_mariadb
```
If no version is specified, the script will automatically fetch and install the latest GA (Generally Available) version of MariaDB.
### User-Configurable Variables
| Variable | Description | Default Value |
|--------------|-----------------------------------------------------------------------------|---------------|
| `MARIADB_VERSION` | Specifies the version of MariaDB to install. If set to `latest`, the script will detect the most recent GA version from the MariaDB mirror site. | `latest`|
---