releases~ReleaseManager()

new ReleaseManager()

Members

fetching

Properties:
Name Type Description
Is any of the providers currently fetching?

Methods

afterPropertiesSet()

Initialization after the components in the application context have been constructed.

checkForNewReleases(skipIfAlreadyFetched) → {Promise.<bool>}

Checks for new releases and exposes them in the Inexor Tree. See Inexor Tree path: /releases/channels/$CHANNEL_NAME/$VERSION_NUMBER - version (string) - either a code name or the semver. - channel (string) - the channel name. - name (string) - an optional release name. - path (string) - the path to the version. Depends on the provider type: absolute path for local_cache, URL for github. - isDownloaded (bool) - whether or not the zip files are already downloaded. - isInstalled (bool) - whether or not the zip files are already unpacked.
Parameters:
Name Type Default Description
skipIfAlreadyFetched bool false If true and the list of releases has been already fetched the list won't be fetched again.
Returns:
Promise.<bool> - - have a look at {link ReleaseManager.fetchReleases}

determinePlatform() → {string}

Determines the platform name as uploaded by Travis currently NOTE: Keep this up-to date! TODO: This is a generic function. Move it to server/util!
Returns:
string - - '{Windows|Linux|Darwin}{32|64}' first is the CMAKE_SYSTEM_NAME, then 32 or 64

downloadRelease(versionRange, channelSearch, doInstall)

Downloads a release for the specific version
Parameters:
Name Type Default Description
versionRange string the semantic version range.
channelSearch string the release channel.
doInstall bool true true, if the release shall be installed after the download has been completed.

getBinaryPath(versionRange, channelSearch) → {string}

Returns the bin folder path of a version.
Parameters:
Name Type Description
versionRange string the semantic version range.
channelSearch string the release channel.
Returns:
string - The binary folder of the specific version or null if no release is installed matching the given versionRange and channelSearch.

getConfigPath(filenameopt) → {string}

Returns the path of the releases.toml.
Parameters:
Name Type Attributes Default Description
filename string <optional>
releases.toml The filename.
Returns:
string - - The path to the configuration file.

getExecutableName(instanceType) → {string}

Returns the name of the executable given its instance type.
Parameters:
Name Type Description
instanceType string either client or server: the InexorCore gameserver or gameclient.
Returns:
string - - inexor-core-${instanceType}.exe (on all platforms)

getOrInstallRelease(versionRange, channelSearch) → {Node|null}

Searches through all releases and returns the one fulfilling the semantic version range the best (and is in the same channel). If no release is installed, it checks for available releases
Parameters:
Name Type Default Description
versionRange string Either: A) the semantic version range it needs to fulfill ('>0.5.2 || 0.3.8') B) an exact non-semantic version ('build', 'buildnew', 'testbinaries')
channelSearch string * additionally you can specify a channel. Only if that channel matches, the release is a match.
Returns:
Node | null - - the InexorTree node or null

getRelease(versionRange, channelSearch, onlyInstalled) → {Node|null}

Searches through all releases and returns the one fulfilling the semantic version range the best (and is in the same channel).
Parameters:
Name Type Default Description
versionRange string Either: A) the semantic version range it needs to fulfill ('>0.5.2 || 0.3.8') B) an exact non-semantic version ('build', 'buildnew', 'testbinaries')
channelSearch string * additionally you can specify a channel. Only if that channel matches, the release is a match.
onlyInstalled bool false only return release which is installed (meaning no remote one, no zip one)
Returns:
Node | null - - the InexorTree node or null

getVersionStrFromZipName(name) → {string|null}

Get version string from the Zip file name uploaded by Travis/Appveyor currently. Returns 0.8.10@stable from inexor-core-0.8.10@stable-Linux.zip valid input is everything fulfilling the pattern inexor-core-- (so also non-zips) TODO: remove magic numbers!
Parameters:
Name Type Description
name string the input string.
Returns:
string | null - - the version or '' if pattern isn't matched

installRelease(versionRange, channelSearch)

Installs a release for the given version
Parameters:
Name Type Description
versionRange string the semantic version range.
channelSearch string the release channel.
Throws:
'Install in progress'

loadConfig(filenameopt) → {Promise.<(bool|string)>}

Loads releases from a TOML file.
Parameters:
Name Type Attributes Default Description
filename string <optional>
releases.toml The filename.
Returns:
Promise.<(bool|string)> - - either true or the error reason

makeZipNameFromVersion(version, channel) → {string}

Returns the ZIP file name. This file name scheme for ZIP files is mandatory. The releases provided by the Inexor Team are created by Travis and Appveyor and uploaded to GitHub. Returns inexor-core-0.8.10@alpha-Linux32.zip if you give it the version 0.8.10 and the channel @alpha. TODO: can we split the release distribution ZIP files into multiple files? - inexor-core-server-${version}@${channel}-${this.platform}.zip - inexor-core-client-${version}@${channel}-${this.platform}.zip
Parameters:
Name Type Description
version string the exact version string.
channel string the exact release channel.
Returns:
string - - inexor-core--.zip

mkdirLocalCache()

Ensures that the local cache folder is available.

saveConfig(filenameopt) → {Promise.<(bool|string)>}

Saves release to a TOML file. Currently doing nothing!
Parameters:
Name Type Attributes Default Description
filename string <optional>
releases.toml The filename.
Returns:
Promise.<(bool|string)> - - either true or the error reason

setDependencies()

Sets the dependencies from the application context.

uninstallRelease(versionRange,, channelSearch,)

Uninstalls a release for the given version
Parameters:
Name Type Description
versionRange, string the semantic version range.
channelSearch, string the release channel.