2 Commits

Author SHA1 Message Date
29e94c7488 Prep for rc5 2023-01-31 14:15:47 -05:00
cc6107ed51 Allow MCVERSION env override 2023-01-31 14:08:20 -05:00
2 changed files with 25 additions and 25 deletions

View File

@@ -23,9 +23,9 @@ $ installJRMC --help
--compat --compat
Build/install MC without minimum dependency version requirements Build/install MC without minimum dependency version requirements
--mcversion VERSION --mcversion VERSION
Build or install a specific MC version, ex. "30.0.51" Build or install a specific MC version, ex. "30.0.55" (default: latest version)
--outputdir PATH --outputdir PATH
Generate rpmbuild output in this PATH (Default: ./output) Generate rpmbuild output in this PATH (default: ./output)
--restorefile RESTOREFILE --restorefile RESTOREFILE
Restore file location for automatic license registration Restore file location for automatic license registration
--betapass PASSWORD --betapass PASSWORD
@@ -33,14 +33,14 @@ $ installJRMC --help
--service, -s SERVICE --service, -s SERVICE
See SERVICES section below for the list of services to deploy See SERVICES section below for the list of services to deploy
--service-type user|system --service-type user|system
Starts services at boot (system) or user login (user) (Default: per-service see SERVICES) Starts services at boot (system) or user login (user) (default: per-service, see SERVICES)
--container, -c CONTAINER (TODO: Under construction) --container, -c CONTAINER (TODO: Under construction)
See CONTAINERS section below for a list of containers to deploy See CONTAINERS section below for a list of containers to deploy
--createrepo[=suse|fedora|centos] --createrepo[=suse|fedora|centos]
Build rpm, copy to webroot, and run createrepo. Build rpm, copy to webroot, and run createrepo.
Optionally, specify a target distro for non-native repo (ex. --createrepo=fedora, note the '=') Optionally, specify a target distro for non-native repo (ex. --createrepo=fedora, note the '=')
--createrepo-webroot PATH --createrepo-webroot PATH
The webroot directory to install the repo (Default: /var/www/jriver/) The webroot directory to install the repo (default: /var/www/jriver/)
--createrepo-user USER --createrepo-user USER
The web server user if different from the current user The web server user if different from the current user
--version, -v --version, -v
@@ -110,9 +110,9 @@ Multiple services (but not `--service-types`) can be installed at one time using
Install MC from the repository and start/enable `jriver-mediacenter.service` as a user service. Install MC from the repository and start/enable `jriver-mediacenter.service` as a user service.
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 30.0.17` * `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 30.0.55`
Build and install an MC 30.0.17 comptability RPM locally and activate it using the `/path/to/license.mjr` Build and install an MC 30.0.55 comptability RPM locally and activate it using the `/path/to/license.mjr`
* `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user` * `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`

View File

@@ -16,14 +16,13 @@
shopt -s extglob shopt -s extglob
declare -g SCRIPTVERSION="1.0-dev" declare -g SCRIPTVERSION="1.0-rc5"
declare -g OUTPUTDIR="$PWD/output" declare -g OUTPUTDIR="$PWD/output"
# MC30 (Buster) # MC30 (Buster)
declare -g BOARDURL="https://yabb.jriver.com/interact/index.php/board,76.0.html" declare -g BOARDURL="https://yabb.jriver.com/interact/index.php/board,76.0.html"
declare -g DEBIANBASE="buster" declare -g DEBIANBASE="buster"
declare -g MCVERSION_HARDCODE="30.0.51" # Hardcoded fallback declare -g MCVERSION_HARDCODE="${MCVERSION:-"30.0.55"}" # Hardcoded fallback
declare -g CREATEREPO_WEBROOT="/var/www/jriver" declare -g CREATEREPO_WEBROOT="/var/www/jriver"
declare -g USER="${SUDO_USER:-$USER}" declare -g USER="${SUDO_USER:-$USER}"
declare -g HOME; HOME=$(getent passwd "$USER" | cut -d: -f6) declare -g HOME; HOME=$(getent passwd "$USER" | cut -d: -f6)
@@ -47,11 +46,11 @@ printHelp() {
--compat --compat
Build/install MC locally without minimum dependency version requirements Build/install MC locally without minimum dependency version requirements
--mcversion VERSION --mcversion VERSION
Specify the MC version, ex. 30.0.51" (default: latest version) Specify the MC version, ex. 30.0.55" (default: latest version)
--outputdir PATH --outputdir PATH
Generate rpmbuild output in this directory (default: ./output) Generate rpmbuild output in this directory (default: ./output)
--restorefile RESTOREFILE --restorefile RESTOREFILE
Restore file location for automatic license registration (default: skip registration) Restore file location for automatic license registration
--betapass PASSWORD --betapass PASSWORD
Enter beta team password for access to beta builds Enter beta team password for access to beta builds
--service, -s SERVICE --service, -s SERVICE
@@ -126,7 +125,9 @@ parseInput() {
declare -g BUILD_SWITCH REPO_INSTALL_SWITCH COMPAT_SWITCH TEST_SWITCH declare -g BUILD_SWITCH REPO_INSTALL_SWITCH COMPAT_SWITCH TEST_SWITCH
declare -g LOCAL_INSTALL_SWITCH CREATEREPO_SWITCH UNINSTALL_SWITCH declare -g LOCAL_INSTALL_SWITCH CREATEREPO_SWITCH UNINSTALL_SWITCH
declare -g OUTPUTDIR RESTOREFILE BETAPASS SERVICE_TYPE VNCPASS USER_DISPLAY CREATEREPO_WEBROOT declare -g USER_VERSION_SWITCH
declare -g OUTPUTDIR RESTOREFILE BETAPASS SERVICE_TYPE
declare -g VNCPASS USER_DISPLAY CREATEREPO_WEBROOT
declare -ga SERVICES CONTAINERS declare -ga SERVICES CONTAINERS
declare long_opts short_opts input declare long_opts short_opts input
@@ -142,8 +143,9 @@ parseInput() {
fi fi
long_opts="install:,build::,outputdir:,mcversion:,restorefile:,betapass:," long_opts="install:,build::,outputdir:,mcversion:,restorefile:,betapass:,"
long_opts+="service-type:,service:,services:,version,debug,help,uninstall,createrepo::," long_opts+="service-type:,service:,services:,version,debug,help,uninstall,"
long_opts+="createrepo-webroot:,createrepo-user:,vncpass:,display:,container:,tests,compat" long_opts+="createrepo::,createrepo-webroot:,createrepo-user:,"
long_opts+="vncpass:,display:,container:,tests,compat"
short_opts="+i:vb::dhus:c:" short_opts="+i:vb::dhus:c:"
if input=$(getopt -o $short_opts -l $long_opts -- "$@"); then if input=$(getopt -o $short_opts -l $long_opts -- "$@"); then
@@ -170,7 +172,9 @@ parseInput() {
shift && OUTPUTDIR="$1" shift && OUTPUTDIR="$1"
;; ;;
--mcversion) --mcversion)
shift && declare -g MCVERSION_INPUT="$1" shift
MCVERSION="$1"
USER_VERSION_SWITCH=1
;; ;;
--restorefile) --restorefile)
shift && RESTOREFILE="$1" shift && RESTOREFILE="$1"
@@ -347,16 +351,12 @@ init() {
setMCVersion() { setMCVersion() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
declare -g MCVERSION MCVERSION_SOURCE MVERSION MCPKG MCRPM declare -g MCVERSION_SOURCE MVERSION MCPKG MCRPM
declare cnt declare cnt
# User input # User input
if [[ -v MCVERSION_INPUT ]]; then if (( USER_VERSION_SWITCH )) &&
if ! [[ "$MCVERSION_INPUT" =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then [[ "$MCVERSION" =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then
err "Incorrect --mcversion format provided"
printHelp && exit 1
fi
MCVERSION="$MCVERSION_INPUT"
MCVERSION_SOURCE="user input" MCVERSION_SOURCE="user input"
# Containerized package manager # Containerized package manager
elif installPackage --silent buildah && elif installPackage --silent buildah &&
@@ -375,8 +375,8 @@ setMCVersion() {
MCVERSION_SOURCE="webscrape" MCVERSION_SOURCE="webscrape"
# Hardcoded # Hardcoded
else else
MCVERSION="$MCVERSION_HARDCODE" declare -g MCVERSION="$MCVERSION_HARDCODE"
MCVERSION_SOURCE="hardcoded version" MCVERSION_SOURCE="hardcoded or MCVERSION env"
err "Warning! Using hardcoded version number" err "Warning! Using hardcoded version number"
fi fi