-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
tools.func
The tools.func file is automatically sourced and can be used in all $APP-install.sh files.
This function automates the installation of a specified version of Node.js and a list of global Node modules on a Debian-based system. It ensures the desired Node.js version is installed (replacing any existing version if necessary) and installs or updates specified Node.js global modules.
install_node_and_modules()
:
- Checks if Node.js is installed.
- If Node.js is installed but not the desired version, it replaces it.
- If Node.js is not installed, it installs the specified version using the NodeSource APT repository.
- It can also install or update a list of global Node modules.
install_node_and_modules
to install the latest version of Node.js with no additional Modules. If you want to define a specified Version and install Modules use something like this:
NODE_VERSION=20 NODE_MODULE="yarn@latest,@vue/[email protected]" install_node_and_modules
Variable | Description | Default Value |
---|---|---|
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. Examples: • yarn@latest • @vue/[email protected] • typescript
|
(empty) |
install_postgresql()
:
- 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.
# Install default PostgreSQL version
install_postgresql
# Install a specific version
PG_VERSION=15 install_postgresql
Variable | Description | Default Value |
---|---|---|
PG_VERSION |
Specifies the major version of PostgreSQL to install or upgrade to (e.g., 14 , 15 , 16 ). |
16 |
- 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
install_mariadb
You can optionally set the MARIADB_VERSION
environment variable before calling the function to specify a particular version to install.
Example:
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.
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 |