The future base of configuration management tooling. Use this set of macros/functions/design-patterns to write independent version managers.
For further detail see https://verMan.io and its organisation https://github.com/verman-io
This idea isn't new, e.g., see:
What is new is taking this to its logical extreme, ending up with independent cross-platform version managers for:
- Databases
- Web servers
- Languages
- Search engines
- Operations
- Applications (dependencies from—some of—↑)
This is not a replacement for any of these technologies. It does simplify their usage, and also simplify usage without any of these tools (e.g., normal native deployment with 5 lines to deploy 5 systems).
In terms of simplifying their usage, your Dockerfile, Chef recipe or what have you become one line (e.g., for a custom MariaDB image) or five lines (e.g., for a full application with no dependent images).
It also makes it easier to mix-and-match with hosted services, e.g., swap out self-hosted PostgreSQL for Google Cloud's DBaaS AlloyDB.
Imagine the CNCF landscape or any arbitrary stack, and being about to swap out components like:
|------------|--------
| Web server | Proxy |
-----------------------------------------
| Database | Cache | Queue | Filesystem |
-----------------------------------------------------
| AI/ML stack | Search engine | Recommender systems |
-----------------------------------------------------
| Language runtime | Function as a Service |
-------------------------------------------
| Logging | Alerting | Security scanning |
------------------------------------------
| De/provisionioning infrastructure |
------------------------------------
This crate defines the CLI that is then used by all these version managers. All arguments are available in all version managers, however more can be added that are very specific to that version manager. Each of the above will have their own GitHub repository and crate, with binary releases available.
Also note that the CLI arguments are language agnostic, e.g., here is a go implementation for PostgreSQL: https://github.com/offscale/postgres-version-manager-go
- https://github.com/asdf-vm/asdf - same idea as this project, without the cross-platform (e.g., incl. Windows) focus
This document contains the help content for the NAME-version-manager-rs
command-line program.
Command Overview:
NAME-version-manager-rs
↴NAME-version-manager-rs download
↴NAME-version-manager-rs download-plan
↴NAME-version-manager-rs env
↴NAME-version-manager-rs install
↴NAME-version-manager-rs install-dependencies
↴NAME-version-manager-rs ls
↴NAME-version-manager-rs ls-remote
↴NAME-version-manager-rs uri
↴NAME-version-manager-rs service
↴NAME-version-manager-rs service install
↴NAME-version-manager-rs service install open-rc
↴NAME-version-manager-rs service install systemd
↴NAME-version-manager-rs service install windows-service
↴NAME-version-manager-rs service reload
↴NAME-version-manager-rs service start
↴NAME-version-manager-rs service stop
↴
Usage: NAME-version-manager-rs [OPTIONS] <COMMAND>
download
— Download specified versiondownload-plan
— Resolve download URL and hash/checksum. Useful for security and concurrency.env
— Print out associated environment variablesinstall
— Install specified versioninstall-dependencies
— Install (only) dependencies for specified versionls
— List what versions are installedls-remote
— List what versions are availableuri
— Print out database connection stringservice
— Service management
-
--vms-config <VMS_CONFIG>
— Config file to read from. If provided used as new default (before env and argv res)Default value:
$HOME/version-managers/NAME-version-manager-rs/vms-config.json
-
--config-read
— Whether to read from config file. If vms_config provided, this defaults totrue
Default value:
false
-
--config-write
— Whether to write to config fileDefault value:
true
-
--app-version <APP_VERSION>
— Desired version of applicationDefault value:
latest
-
--vm-root <VM_ROOT>
— root directory for all version-managers. For download cache and interdependenciesDefault value:
$HOME/version-managers
-
--root <ROOT>
— Root directory. By default all paths are relative to this oneDefault value:
$HOME/version-managers/NAME-version-manager-rs
-
--hostname <HOSTNAME>
— Hostname of serverDefault value:
localhost
-
-p
,--port <PORT>
— Port for server to listen on -
--database <DATABASE>
— Database nameDefault value:
database
-
--runtime-path <RUNTIME_PATH>
— Runtime path. This is where PID files and/or similar temporary files are storedDefault value:
$HOME/version-managers/NAME-version-manager-rs/NAME-version-manager-rs/$APP_VERSION/run
-
--data-path <DATA_PATH>
— Data path. This is where the actual data is stored, e.g., the .db and WAL filesDefault value:
$HOME/version-managers/NAME-version-manager-rs/NAME-version-manager-rs/$APP_VERSION/data
-
--bin-path <BIN_PATH>
— Binary path. Where the executable binary are located. Sometimes called PREFIXDefault value:
$HOME/version-managers/NAME-version-manager-rs/NAME-version-manager-rs/$APP_VERSION/bin
-
--logs-path <LOGS_PATH>
— Logs path. Where the log files are to be storedDefault value:
$HOME/version-managers/NAME-version-manager-rs/NAME-version-manager-rs/$APP_VERSION/logs
-
--locale <LOCALE>
— Locale to useDefault value:
en_US.UTF-8
-
--markdown-help
— Markdown help generator. Only really used to generate replacement README.md files
Download specified version
Usage: NAME-version-manager-rs download [VERSION]
<VERSION>
— version to install, defaults to global arg if provided otherwise env var
Resolve download URL and hash/checksum. Useful for security and concurrency.
Usage: NAME-version-manager-rs download-plan [VERSION]
<VERSION>
— version to install, defaults to global arg if provided otherwise env var
Print out associated environment variables
Usage: NAME-version-manager-rs env
Install specified version
Usage: NAME-version-manager-rs install [VERSION] [SKIP_DEPENDENCIES]...
<VERSION>
— version to install, defaults to global arg if provided otherwise env var<SKIP_DEPENDENCIES>
— dependencies to skip installation of, defaults to install all. Skip all with *
Install (only) dependencies for specified version
Usage: NAME-version-manager-rs install-dependencies [VERSION]
<VERSION>
— version to install, defaults to global arg if provided otherwise env var
List what versions are installed
Usage: NAME-version-manager-rs ls
List what versions are available
Usage: NAME-version-manager-rs ls-remote
Print out database connection string
Usage: NAME-version-manager-rs uri
Service management
Usage: NAME-version-manager-rs service <COMMAND>
install
— Install service (daemon), e.g., systemd, OpenRC, windows-servicereload
— Reload specified versionstart
— Start specified versionstop
— Stop specified version
Install service (daemon), e.g., systemd, OpenRC, windows-service
Usage: NAME-version-manager-rs service install install <COMMAND>
open-rc
— Install OpenRC servicesystemd
— Install systemd servicewindows-service
— Install Windows Service
Install OpenRC service
Usage: NAME-version-manager-rs service install open-rc [OPTIONS]
-
--group <GROUP>
— user group to run service asDefault value:
NAME-version-manager-rs
-
--config-install-path <CONFIG_INSTALL_PATH>
— where to install the config fileDefault value:
/etc/conf.d/NAME-version-manager-rs
-
--service-install-path <SERVICE_INSTALL_PATH>
— where to install the service fileDefault value:
/etc/init.d/NAME-version-manager-rs
-
--user <USER>
— user to run service asDefault value:
NAME-version-manager-rs
Install systemd service
Usage: NAME-version-manager-rs service install systemd [OPTIONS]
-
--group <GROUP>
— user group to run service asDefault value:
NAME-version-manager-rs
-
--service-install-path <SERVICE_INSTALL_PATH>
— where to install the service fileDefault value:
/etc/systemd/system/NAME-version-manager-rs.service
-
--user <USER>
— user to run service asDefault value:
NAME-version-manager-rs
Install Windows Service
Usage: NAME-version-manager-rs service install windows-service [OPTIONS]
-
--service-name <SERVICE_NAME>
— name of serviceDefault value:
NAME-version-manager-rs
-
--service-description <SERVICE_DESCRIPTION>
— description of serviceDefault value: ``
Reload specified version
Usage: NAME-version-manager-rs service reload [VERSION]
<VERSION>
— version to install, defaults to global arg if provided otherwise env var
Start specified version
Usage: NAME-version-manager-rs service start [VERSION]
<VERSION>
— version to install, defaults to global arg if provided otherwise env var
Stop specified version
Usage: NAME-version-manager-rs service stop [VERSION]
<VERSION>
— version to install, defaults to global arg if provided otherwise env var
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.